diff --git a/charts/physims/charts/dlsim/values.yaml b/charts/physims/charts/dlsim/values.yaml
index c0142b50ae..d78fbb7409 100644
--- a/charts/physims/charts/dlsim/values.yaml
+++ b/charts/physims/charts/dlsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/ldpctest/values.yaml b/charts/physims/charts/ldpctest/values.yaml
index 91eab91af5..e2e6467923 100644
--- a/charts/physims/charts/ldpctest/values.yaml
+++ b/charts/physims/charts/ldpctest/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-dlschsim/values.yaml b/charts/physims/charts/nr-dlschsim/values.yaml
index e96541102c..8944e7e724 100644
--- a/charts/physims/charts/nr-dlschsim/values.yaml
+++ b/charts/physims/charts/nr-dlschsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-dlsim/values.yaml b/charts/physims/charts/nr-dlsim/values.yaml
index c86fc96cff..573e8630de 100644
--- a/charts/physims/charts/nr-dlsim/values.yaml
+++ b/charts/physims/charts/nr-dlsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-pbchsim/values.yaml b/charts/physims/charts/nr-pbchsim/values.yaml
index 62d89f9632..28c4678334 100644
--- a/charts/physims/charts/nr-pbchsim/values.yaml
+++ b/charts/physims/charts/nr-pbchsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-prachsim/values.yaml b/charts/physims/charts/nr-prachsim/values.yaml
index 3ea9787f7a..9e3c68b54d 100644
--- a/charts/physims/charts/nr-prachsim/values.yaml
+++ b/charts/physims/charts/nr-prachsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-pucchsim/values.yaml b/charts/physims/charts/nr-pucchsim/values.yaml
index cf50c0bd3c..449670f713 100644
--- a/charts/physims/charts/nr-pucchsim/values.yaml
+++ b/charts/physims/charts/nr-pucchsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-ulschsim/values.yaml b/charts/physims/charts/nr-ulschsim/values.yaml
index 420b154596..a3afc090e8 100644
--- a/charts/physims/charts/nr-ulschsim/values.yaml
+++ b/charts/physims/charts/nr-ulschsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/nr-ulsim/values.yaml b/charts/physims/charts/nr-ulsim/values.yaml
index 7eb8e33fcb..2bf96498e8 100644
--- a/charts/physims/charts/nr-ulsim/values.yaml
+++ b/charts/physims/charts/nr-ulsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/polartest/values.yaml b/charts/physims/charts/polartest/values.yaml
index 496dc8afba..e0a532fdd8 100644
--- a/charts/physims/charts/polartest/values.yaml
+++ b/charts/physims/charts/polartest/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/smallblocktest/values.yaml b/charts/physims/charts/smallblocktest/values.yaml
index 9dd791265f..f2f113d9b6 100644
--- a/charts/physims/charts/smallblocktest/values.yaml
+++ b/charts/physims/charts/smallblocktest/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/charts/physims/charts/ulsim/values.yaml b/charts/physims/charts/ulsim/values.yaml
index f5110989d8..35dc14d596 100644
--- a/charts/physims/charts/ulsim/values.yaml
+++ b/charts/physims/charts/ulsim/values.yaml
@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
- # capabilities:
+ capabilities:
+ add:
+ - SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py
index e606513935..2b19a80984 100644
--- a/ci-scripts/cls_containerize.py
+++ b/ci-scripts/cls_containerize.py
@@ -636,7 +636,7 @@ class Containerize():
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + self.eNB_logFile[self.eNB_instance], self.eNBSourceCodePath + '/cmake_targets/')
logging.info('\u001B[1m Undeploying OAI Object Pass\u001B[0m')
- def DeployGenObject(self, HTML):
+ def DeployGenObject(self, HTML, RAN, UE):
self.exitStatus = 0
logging.info('\u001B[1m Checking Services to deploy\u001B[0m')
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose config --services'
@@ -679,12 +679,15 @@ class Containerize():
healthy = 0
while (count < 10):
count += 1
+ containerStatus = []
deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
healthy = 0
for state in deployStatus.split('\n'):
- res = re.search('Up \(healthy\)', state)
- if res is not None:
+ if re.search('Up \(healthy\)', state) is not None:
healthy += 1
+ if re.search('rfsim4g-db-init.*Exit 0', state) is not None:
+ subprocess.check_output('docker rm -f rfsim4g-db-init || true', shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
+ containerStatus.append(state)
if healthy == self.nb_healthy[0]:
count = 100
else:
@@ -694,27 +697,41 @@ class Containerize():
if self.tsharkStarted == False:
logging.debug('Starting tshark on public network')
self.CaptureOnDockerNetworks()
- self.tsharkStarted = True
HTML.CreateHtmlTestRow('n/a', 'OK', CONST.ALL_PROCESSES_OK)
+ for cState in containerStatus:
+ logging.debug(cState)
logging.info('\u001B[1m Deploying OAI Object(s) PASS\u001B[0m')
else:
- self.exitStatus = 1
HTML.CreateHtmlTestRow('Could not deploy in time', 'KO', CONST.ALL_PROCESSES_OK)
+ for cState in containerStatus:
+ logging.debug(cState)
logging.error('\u001B[1m Deploying OAI Object(s) FAILED\u001B[0m')
+ HTML.testCase_id = 'AUTO-UNDEPLOY'
+ UE.testCase_id = 'AUTO-UNDEPLOY'
+ HTML.desc = 'Automatic Undeployment'
+ UE.desc = 'Automatic Undeployment'
+ UE.ShowTestID()
+ self.UndeployGenObject(HTML, RAN, UE)
+ self.exitStatus = 1
def CaptureOnDockerNetworks(self):
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
- cmd = 'sudo nohup tshark -f "not tcp and not arp and not port 53 and not host archive.ubuntu.com and not host security.ubuntu.com and not port 2152"'
+ if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None:
+ cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"'
+ elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None:
+ cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"'
+ else:
+ return
for name in networkNames.split('\n'):
- res = re.search('rfsim', name)
- if res is not None:
+ if re.search('rfsim', name) is not None:
cmd += ' -i ' + name
cmd += ' -w /tmp/capture_'
ymlPath = self.yamlPath[0].split('/')
cmd += ymlPath[1] + '.pcap > /tmp/tshark.log 2>&1 &'
logging.debug(cmd)
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
+ self.tsharkStarted = True
def UndeployGenObject(self, HTML, RAN, UE):
self.exitStatus = 0
@@ -745,7 +762,11 @@ class Containerize():
cName = res.group('container_name')
cmd = 'cd ' + self.yamlPath[0] + ' && docker logs ' + cName + ' > ' + cName + '.log 2>&1'
logging.debug(cmd)
- deployStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
+ if re.search('magma-mme', cName) is not None:
+ cmd = 'cd ' + self.yamlPath[0] + ' && docker cp -L ' + cName + ':/var/log/mme.log ' + cName + '-full.log'
+ logging.debug(cmd)
+ subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
fullStatus = True
if anyLogs:
cmd = 'mkdir -p '+ logPath + ' && cp ' + self.yamlPath[0] + '/*.log ' + logPath
diff --git a/ci-scripts/cls_physim1.py b/ci-scripts/cls_physim1.py
index b7a730e91c..83fb74b7cb 100644
--- a/ci-scripts/cls_physim1.py
+++ b/ci-scripts/cls_physim1.py
@@ -246,7 +246,7 @@ class PhySim:
isFinished = False
# doing a deep copy!
tmpPodNames = podNames.copy()
- while(count < 32 and isFinished == False):
+ while(count < 50 and isFinished == False):
time.sleep(60)
for podName in tmpPodNames:
mySSH.command2(f'oc logs --tail=1 {podName} 2>&1', 6, silent=True)
diff --git a/ci-scripts/conf_files/benetel-4g.conf b/ci-scripts/conf_files/benetel-4g.conf
index 9423ebe56e..e2974a171d 100644
--- a/ci-scripts/conf_files/benetel-4g.conf
+++ b/ci-scripts/conf_files/benetel-4g.conf
@@ -269,17 +269,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/benetel-5g.conf b/ci-scripts/conf_files/benetel-5g.conf
index dc86567c1f..bfe61188b6 100644
--- a/ci-scripts/conf_files/benetel-5g.conf
+++ b/ci-scripts/conf_files/benetel-5g.conf
@@ -262,18 +262,11 @@ THREAD_STRUCT = (
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf
index e2c94b14ab..1102528cd3 100644
--- a/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf
+++ b/ci-scripts/conf_files/cu.band7.tm1.100PRB.conf
@@ -201,15 +201,10 @@ eNBs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
pdcp_log_level = "info";
- pdcp_log_verbosity = "high";
rrc_log_level = "info";
- rrc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
gtp_log_level = "info";
- gtp_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf
index 5b994ed29b..ec7620a724 100644
--- a/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf
+++ b/ci-scripts/conf_files/cu.band7.tm1.25PRB.conf
@@ -201,15 +201,10 @@ eNBs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
pdcp_log_level = "info";
- pdcp_log_verbosity = "high";
rrc_log_level = "info";
- rrc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
gtp_log_level = "info";
- gtp_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf
index 148c5a9903..7e64ad8039 100644
--- a/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf
+++ b/ci-scripts/conf_files/cu.band7.tm1.50PRB.conf
@@ -201,15 +201,10 @@ eNBs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
pdcp_log_level = "info";
- pdcp_log_verbosity = "high";
rrc_log_level = "info";
- rrc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
gtp_log_level = "info";
- gtp_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf
index a3ecffb9be..217c694055 100644
--- a/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/du.band7.tm1.100PRB.usrpb210.conf
@@ -96,17 +96,11 @@ RUs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
hw_log_level = "info";
- hw_log_verbosity = "medium";
phy_log_level = "info";
- phy_log_verbosity = "medium";
mac_log_level = "info";
- mac_log_verbosity = "high";
rlc_log_level = "info";
- rlc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf
index 1920992d70..61d4cff51b 100644
--- a/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/du.band7.tm1.25PRB.usrpb210.conf
@@ -96,17 +96,11 @@ RUs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
hw_log_level = "info";
- hw_log_verbosity = "medium";
phy_log_level = "info";
- phy_log_verbosity = "medium";
mac_log_level = "info";
- mac_log_verbosity = "high";
rlc_log_level = "info";
- rlc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf
index 5df8da05a3..4342e8f4b4 100644
--- a/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/du.band7.tm1.50PRB.usrpb210.conf
@@ -96,17 +96,11 @@ RUs = (
log_config = {
global_log_level = "info";
- global_log_verbosity = "medium";
hw_log_level = "info";
- hw_log_verbosity = "medium";
phy_log_level = "info";
- phy_log_verbosity = "medium";
mac_log_level = "info";
- mac_log_verbosity = "high";
rlc_log_level = "info";
- rlc_log_verbosity = "medium";
flexran_agent_log_level = "info";
- flexran_agent_log_verbosity = "medium";
};
NETWORK_CONTROLLER : {
diff --git a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf
index e70ca78205..122654df26 100644
--- a/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band13.tm1.25PRB.usrpb210.conf
@@ -257,18 +257,11 @@ THREAD_STRUCT = (
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 400d1a6c9d..ae572f9e05 100644
--- a/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf
+++ b/ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf
@@ -385,19 +385,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
@@ -457,17 +450,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf
index bd2999b5d5..5a4be9f187 100644
--- a/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band17.tm1.25PRB.usrpb210.conf
@@ -260,18 +260,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf
index 19ef6d0797..7ac056b75e 100644
--- a/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band17.tm1.mbms.25PRB.usrpb210.conf
@@ -404,18 +404,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
index d2e91fb872..24c35dedbf 100644
--- a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
@@ -264,18 +264,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf
index f116c3708d..4a16a64105 100644
--- a/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.lte_2x2_tm2.100PRB.usrpn310.conf
@@ -264,18 +264,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
index 6c8d5ba6f0..bccd37abe9 100644
--- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
@@ -264,18 +264,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 f34878c569..0633d233ef 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 e2e482a7c7..4de8a3f759 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 bfea139e92..df902faf8b 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
diff --git a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf
index 4e0025770b..0da4b1181a 100644
--- a/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band40.tm2.25PRB.FairScheduler.usrpb210.conf
@@ -163,19 +163,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 1627d21e1a..bd7e19ca60 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf
@@ -256,18 +256,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf
index efa1fa64b8..fdd2304ba5 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.slave.usrpb210.conf
@@ -265,18 +265,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 6fc8401236..5b05627700 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
@@ -263,18 +263,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 087ee37f01..44d22a8953 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf
@@ -263,19 +263,12 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
@include "channelmod_rfsimu.conf"
diff --git a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
index 64bcb4b35f..38cd90cd44 100644
--- a/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
@@ -264,18 +264,11 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="high";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="high";
pdcp_log_level ="info";
- pdcp_log_verbosity ="high";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 72754165d0..c8223d0c42 100644
--- a/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.band7.tm2.25PRB.usrpb210.conf
@@ -258,17 +258,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf
index da65aad775..609d76d720 100644
--- a/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/enb.slave.band13.tm1.25PRB.usrpb210.conf
@@ -262,18 +262,11 @@ THREAD_STRUCT = (
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf
index 682fb376cf..a98179197f 100644
--- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -306,20 +306,12 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf
index f5563ecc02..22ffb4cd3d 100644
--- a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf
index f5563ecc02..22ffb4cd3d 100644
--- a/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_nr-ue0.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf
index 5df3ccf6cc..3d1c008f23 100644
--- a/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_nr-ue1.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf
index b1ce5fee8d..73c3292809 100644
--- a/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_nr-ue2.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf
index aea5104f1c..1f8f7306c6 100644
--- a/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_nr-ue3.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf
index 4e596f81b5..81951e5219 100644
--- a/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_rcc.band7.tm1.nfapi.conf
@@ -231,17 +231,10 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf
index b64b88ddea..9b3f205a0f 100644
--- a/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_rcc.band78.tm1.106PRB.nfapi.conf
@@ -248,18 +248,11 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf
index 0170a46655..8f7c8ee68a 100644
--- a/ci-scripts/conf_files/episci/episci_ue.nfapi.conf
+++ b/ci-scripts/conf_files/episci/episci_ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
diff --git a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
index c0d4c6d4c9..0597e96245 100644
--- a/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/episci/proxy_gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -307,20 +307,12 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf
index 8411ed8fc6..b6c0e9b5a1 100644
--- a/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf
+++ b/ci-scripts/conf_files/episci/proxy_nr-ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
uicc0 = {
diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf
index d4c72d6c14..50ece56b23 100644
--- a/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf
+++ b/ci-scripts/conf_files/episci/proxy_rcc.band7.tm1.nfapi.conf
@@ -231,17 +231,10 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf
index 0ef317d63e..3410104199 100644
--- a/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf
+++ b/ci-scripts/conf_files/episci/proxy_rcc.band78.tm1.106PRB.nfapi.conf
@@ -288,18 +288,11 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf
index 3f227d573c..51c30fb42d 100644
--- a/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf
+++ b/ci-scripts/conf_files/episci/proxy_ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf
index d3cfbfc973..1e84e479bc 100644
--- a/ci-scripts/conf_files/gNB_SA_CU.conf
+++ b/ci-scripts/conf_files/gNB_SA_CU.conf
@@ -254,22 +254,13 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="debug";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gNB_SA_DU.conf b/ci-scripts/conf_files/gNB_SA_DU.conf
index adcbcd45d0..95fa75bc1d 100644
--- a/ci-scripts/conf_files/gNB_SA_DU.conf
+++ b/ci-scripts/conf_files/gNB_SA_DU.conf
@@ -273,22 +273,13 @@ serveraddr = "server";
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
- rlc_log_level ="debug";
- rlc_log_verbosity ="medium";
+ rlc_log_level ="info";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
ngap_log_level ="debug";
- ngap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
index e3bdde8469..082cc826f3 100644
--- a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
+++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
@@ -291,19 +291,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
index 3955b1542e..6af8a23407 100644
--- a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
+++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
@@ -287,19 +287,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
index dd9c210c0d..e8c6cab1b4 100644
--- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
@@ -266,18 +266,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
index 2400136f9f..7d3409d4d4 100644
--- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
@@ -137,20 +137,6 @@ gNBs =
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
subcarrierSpacing = 1;
-
- #tdd-UL-DL-ConfigurationCommon
-# subcarrierSpacing
-# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
- referenceSubcarrierSpacing = 1;
- # pattern1
- # dl_UL_TransmissionPeriodicity
- # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
- dl_UL_TransmissionPeriodicity = 6;
- nrofDownlinkSlots = 7;
- nrofDownlinkSymbols = 6;
- nrofUplinkSlots = 2;
- nrofUplinkSymbols = 4;
-
ssPBCH_BlockPower = -25;
}
@@ -259,18 +245,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
index adb79ceb8d..e798e40d64 100644
--- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
@@ -266,18 +266,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
index 72ead42784..b92c7df92d 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
@@ -294,19 +294,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
index 32a40fe951..6c778a7c31 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -298,19 +298,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
index 3579d1e3c2..5c826ca862 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.162PRB.2x2.usrpn310.conf
@@ -293,19 +293,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
f1ap_log_level ="debug";
- f1ap_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
index 9cc8f554e8..d21cf90cd9 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
@@ -255,18 +255,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
index 249b7e4527..55cb7b36c4 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
@@ -263,19 +263,12 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
uicc: {
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
index f232106d56..7c4bb9cc59 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
@@ -265,19 +265,12 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
uicc: {
diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
new file mode 100644
index 0000000000..7f5a9d4343
--- /dev/null
+++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
@@ -0,0 +1,291 @@
+Active_gNBs = ( "gNB-Eurecom-5GNRBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_ID = 0xe00;
+ gNB_name = "gNB-Eurecom-5GNRBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 95;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 2;
+ sd = 2; // 0 false, else true
+ }
+ );
+
+ });
+
+ nr_cellid = 12345678L;
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 1;
+ min_rxtxtime = 6;
+ sib1_tda = 0;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 12;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 433096;
+ dl_frequencyBand = 66;
+ # this is 3600 MHz
+ dl_absoluteFrequencyPointA = 430000;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=27,L=48 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 12;
+ initialDLBWPsearchSpaceZero = 0;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 66;
+ ul_absoluteFrequencyPointA = 350000;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 13475;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 13;
+ preambleReceivedTargetPower = -118;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
+ #
+ msg1_SubcarrierSpacing = 1,
+# restrictedSetConfig
+# 0=unrestricted, 1=restricted type A, 2=restricted type B
+ restrictedSetConfig = 0,
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ amf_ip_address = ( { ipv4 = "192.168.70.132";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ ulsch_max_slots_inactivity = 100;
+ pusch_TargetSNRx10 = 200;
+ pucch_TargetSNRx10 = 200;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 1
+ nb_rx = 1
+ att_tx = 0
+ att_rx = 0;
+ bands = [7];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ #beamforming 1x4 matrix:
+ bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
+ clock_src = "internal";
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+rfsimulator :
+{
+ serveraddr = "server";
+ serverport = "4043";
+ options = (); #("saviq"); or/and "chanmod"
+ modelname = "AWGN";
+ IQfile = "/tmp/rfsimulator.iqs";
+};
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ hw_log_level ="info";
+ phy_log_level ="info";
+ mac_log_level ="info";
+ rlc_log_level ="info";
+ pdcp_log_level ="info";
+ rrc_log_level ="info";
+ ngap_log_level ="debug";
+ };
+
diff --git a/ci-scripts/conf_files/lte-fdd-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-basic-sim.conf
index a4d8e007dc..6c81d512a6 100644
--- a/ci-scripts/conf_files/lte-fdd-basic-sim.conf
+++ b/ci-scripts/conf_files/lte-fdd-basic-sim.conf
@@ -257,17 +257,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf
index 458ab7cf89..c2f6ab9d6c 100644
--- a/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf
+++ b/ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf
@@ -406,19 +406,12 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
//rfsimulator :
diff --git a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf
index e80ff2b9cb..9c74d2e328 100644
--- a/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf
+++ b/ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf
@@ -406,19 +406,12 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
//rfsimulator :
diff --git a/ci-scripts/conf_files/lte-tdd-basic-sim.conf b/ci-scripts/conf_files/lte-tdd-basic-sim.conf
index f443a907f2..ddfdddda83 100644
--- a/ci-scripts/conf_files/lte-tdd-basic-sim.conf
+++ b/ci-scripts/conf_files/lte-tdd-basic-sim.conf
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
diff --git a/ci-scripts/conf_files/nr-ue.nfapi.conf b/ci-scripts/conf_files/nr-ue.nfapi.conf
index b12e0c8d05..90798702cf 100644
--- a/ci-scripts/conf_files/nr-ue.nfapi.conf
+++ b/ci-scripts/conf_files/nr-ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
diff --git a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf
index 502e3c548a..6651f380e4 100644
--- a/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf
+++ b/ci-scripts/conf_files/rcc.band38.tm1.50PRB.multi.rru.conf
@@ -227,17 +227,10 @@ THREAD_STRUCT = (
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 d01e4e1c4e..47bcc35cb3 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
@@ -168,19 +168,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 7f6bff304d..660478ca11 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
@@ -168,19 +168,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 d4f2eb9ef2..6997c80234 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
@@ -168,19 +168,12 @@ eNBs =
log_config :
{
global_log_level ="debug";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
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 683fff0bc8..798871edce 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
@@ -263,17 +263,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 574c8b2545..628188aea2 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
@@ -263,17 +263,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
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 49365a1f61..75d947c009 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
@@ -263,17 +263,10 @@ NETWORK_CONTROLLER :
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf
index 640b85930a..1bcd26b931 100644
--- a/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf
+++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms-s1ap.if4p5.50PRB.lo.conf
@@ -365,17 +365,10 @@ THREAD_STRUCT = (
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf
index 7fe682f29e..e398310a35 100644
--- a/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf
+++ b/ci-scripts/conf_files/rcc.band7.tm1.mbms.if4p5.50PRB.lo.conf
@@ -365,17 +365,10 @@ THREAD_STRUCT = (
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf
index 281f7433af..6f7a5d2dfd 100644
--- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf
+++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf
@@ -230,17 +230,10 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rru.band38.tm1.master.conf b/ci-scripts/conf_files/rru.band38.tm1.master.conf
index 101ce83892..e6bd0b75aa 100644
--- a/ci-scripts/conf_files/rru.band38.tm1.master.conf
+++ b/ci-scripts/conf_files/rru.band38.tm1.master.conf
@@ -30,18 +30,11 @@ THREAD_STRUCT = (
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rru.band38.tm1.slave.conf b/ci-scripts/conf_files/rru.band38.tm1.slave.conf
index d5efe6bd61..2bc79028b4 100644
--- a/ci-scripts/conf_files/rru.band38.tm1.slave.conf
+++ b/ci-scripts/conf_files/rru.band38.tm1.slave.conf
@@ -30,18 +30,11 @@ THREAD_STRUCT = (
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rru.fdd.band7.conf b/ci-scripts/conf_files/rru.fdd.band7.conf
index 057f518046..a3b297049d 100644
--- a/ci-scripts/conf_files/rru.fdd.band7.conf
+++ b/ci-scripts/conf_files/rru.fdd.band7.conf
@@ -31,17 +31,10 @@ THREAD_STRUCT =
log_config =
{
global_log_level ="error";
- global_log_verbosity ="medium";
hw_log_level ="error";
- hw_log_verbosity ="medium";
phy_log_level ="error";
- phy_log_verbosity ="medium";
mac_log_level ="error";
- mac_log_verbosity ="high";
rlc_log_level ="error";
- rlc_log_verbosity ="medium";
pdcp_log_level ="error";
- pdcp_log_verbosity ="medium";
rrc_log_level ="error";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/rru.tdd.band40.conf b/ci-scripts/conf_files/rru.tdd.band40.conf
index 5ce3a515f5..40af241cca 100644
--- a/ci-scripts/conf_files/rru.tdd.band40.conf
+++ b/ci-scripts/conf_files/rru.tdd.band40.conf
@@ -31,17 +31,10 @@ THREAD_STRUCT =
log_config =
{
global_log_level ="error";
- global_log_verbosity ="medium";
hw_log_level ="error";
- hw_log_verbosity ="medium";
phy_log_level ="error";
- phy_log_verbosity ="medium";
mac_log_level ="error";
- mac_log_verbosity ="high";
rlc_log_level ="error";
- rlc_log_verbosity ="medium";
pdcp_log_level ="error";
- pdcp_log_verbosity ="medium";
rrc_log_level ="error";
- rrc_log_verbosity ="medium";
};
diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf
index 2b602cbcf2..09ad7529b1 100644
--- a/ci-scripts/conf_files/ue.nfapi.conf
+++ b/ci-scripts/conf_files/ue.nfapi.conf
@@ -1,18 +1,11 @@
log_config = {
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="medium";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="full";
};
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index 43772fb655..5357a90a3d 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -910,7 +910,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Deploy_Run_PhySim':
PHYSIM.Deploy_PhySim(HTML, RAN)
elif action == 'DeployGenObject':
- CONTAINERS.DeployGenObject(HTML)
+ CONTAINERS.DeployGenObject(HTML, RAN, CiTestObj)
if CONTAINERS.exitStatus==1:
RAN.prematureExit = True
elif action == 'UndeployGenObject':
diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml
index fd254f1856..a598b2bdc1 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz.xml
@@ -66,8 +66,8 @@
DeployGenObject
Deploy OAI 4G CoreNetwork
yaml_files/4g_rfsimulator_fdd_05MHz
- oai_hss oai_mme oai_spgwc oai_spgwu trf_gen
- 6
+ oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen
+ 7
@@ -75,15 +75,15 @@
Deploy OAI 4G eNB RF sim (FDD 05MHz)
yaml_files/4g_rfsimulator_fdd_05MHz
enb
- 7
+ 8
DeployGenObject
- Deploy OAI 4G NR-UE RF sim (FDD 05MHz)
+ Deploy OAI 4G LTE-UE RF sim (FDD 05MHz)
yaml_files/4g_rfsimulator_fdd_05MHz
oai_ue0
- 8
+ 9
diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml
index 2ff9461b93..07ea358ad5 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_05MHz_noS1.xml
@@ -60,7 +60,7 @@
DeployGenObject
- Deploy OAI 4G NR-UE RF sim (FDD 05MHz)
+ Deploy OAI 4G LTE-UE RF sim (FDD 05MHz)
yaml_files/4g_rfsimulator_fdd_05MHz_noS1
oai_ue0
2
diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml
index f00e277c36..29acfa3b09 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_10MHz.xml
@@ -66,8 +66,8 @@
DeployGenObject
Deploy OAI 4G CoreNetwork
yaml_files/4g_rfsimulator_fdd_10MHz
- oai_hss oai_mme oai_spgwc oai_spgwu trf_gen
- 6
+ oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen
+ 7
@@ -75,15 +75,15 @@
Deploy OAI 4G eNB RF sim (FDD 10MHz)
yaml_files/4g_rfsimulator_fdd_10MHz
enb
- 7
+ 8
DeployGenObject
- Deploy OAI 4G NR-UE RF sim (FDD 10MHz)
+ Deploy OAI 4G LTE-UE RF sim (FDD 10MHz)
yaml_files/4g_rfsimulator_fdd_10MHz
oai_ue0
- 8
+ 9
diff --git a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml
index 52e1ac7de1..74f712ebda 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_fdd_20MHz.xml
@@ -66,8 +66,8 @@
DeployGenObject
Deploy OAI 4G CoreNetwork
yaml_files/4g_rfsimulator_fdd_20MHz
- oai_hss oai_mme oai_spgwc oai_spgwu trf_gen
- 6
+ oai_hss redis magma_mme oai_spgwc oai_spgwu trf_gen
+ 7
@@ -75,15 +75,15 @@
Deploy OAI 4G eNB RF sim (FDD 20MHz)
yaml_files/4g_rfsimulator_fdd_20MHz
enb
- 7
+ 8
DeployGenObject
- Deploy OAI 4G NR-UE RF sim (FDD 20MHz)
+ Deploy OAI 4G LTE-UE RF sim (FDD 20MHz)
yaml_files/4g_rfsimulator_fdd_20MHz
oai_ue0
- 8
+ 9
diff --git a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml
index cdaee430ef..aa70db1fed 100644
--- a/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml
+++ b/ci-scripts/xml_files/container_4g_rfsim_tdd_05MHz.xml
@@ -81,7 +81,7 @@
DeployGenObject
- Deploy OAI 4G NR-UE RF sim (TDD 05MHz)
+ Deploy OAI 4G LTE-UE RF sim (TDD 05MHz)
yaml_files/4g_rfsimulator_tdd_05MHz
oai_ue0
8
diff --git a/ci-scripts/xml_files/container_5g_f1_rfsim.xml b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
index 501f2fe46f..fc24a3d67c 100644
--- a/ci-scripts/xml_files/container_5g_f1_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_f1_rfsim.xml
@@ -100,7 +100,7 @@
rfsim5g-oai-nr-ue
rfsim5g-oai-ext-dn
-B 12.1.1.2 -u -i 1 -s
- -c 12.1.1.2 -u -i 1 -t 30 -b 200K
+ -c 12.1.1.2 -u -i 1 -t 30 -b 3M
@@ -109,7 +109,7 @@
rfsim5g-oai-ext-dn
rfsim5g-oai-nr-ue
-u -i 1 -s
- -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 5K
+ -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M
diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml
new file mode 100644
index 0000000000..28269b2d03
--- /dev/null
+++ b/ci-scripts/xml_files/container_5g_fdd_rfsim.xml
@@ -0,0 +1,116 @@
+
+
+ rfsim-5gnr-fdd
+ Testing 5G NR RF sim - Monolithic FDD gNB
+ wrench
+ 4
+
+ 100011
+ 000010
+ 000011
+ 000012
+ 000013
+ 020011
+ 020012
+ 100011
+
+
+
+
+
+ DeployGenObject
+ Deploy MySql Database
+ yaml_files/5g_fdd_rfsimulator
+ mysql
+ 1
+
+
+
+ DeployGenObject
+ Deploy OAI 5G CoreNetwork
+ yaml_files/5g_fdd_rfsimulator
+ oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
+ 6
+
+
+
+ DeployGenObject
+ Deploy OAI 5G gNB RF sim SA
+ yaml_files/5g_fdd_rfsimulator
+ oai-gnb
+ 7
+
+
+
+ DeployGenObject
+ Deploy OAI 5G NR-UE RF sim SA
+ yaml_files/5g_fdd_rfsimulator
+ oai-nr-ue
+ 8
+
+
+
+ PingFromContainer
+ Ping ext-dn from NR-UE
+ rfsim5g-oai-nr-ue
+ -I oaitun_ue1 -c 20 192.168.72.135
+ 5
+
+
+
+ PingFromContainer
+ Ping NR-UE from ext-dn
+ rfsim5g-oai-ext-dn
+ -c 20 12.1.1.2
+ 5
+
+
+
+ IperfFromContainer
+ Iperf UDP Downlink
+ rfsim5g-oai-nr-ue
+ rfsim5g-oai-ext-dn
+ -B 12.1.1.2 -u -i 1 -s
+ -c 12.1.1.2 -u -i 1 -t 30 -b 3M
+
+
+
+ IperfFromContainer
+ Iperf UDP Uplink
+ rfsim5g-oai-ext-dn
+ rfsim5g-oai-nr-ue
+ -u -i 1 -s
+ -B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M
+
+
+
+ UndeployGenObject
+ Undeploy all OAI 5G stack
+ yaml_files/5g_fdd_rfsimulator
+
+
+
diff --git a/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml
new file mode 100644
index 0000000000..d960949f7d
--- /dev/null
+++ b/ci-scripts/xml_files/container_5g_fdd_rfsim_down.xml
@@ -0,0 +1,38 @@
+
+
+ rfsim-5gnr-fdd-down
+ CleanUp 5G RF - Monolithic FDD gNB
+ trash
+
+ 100012
+
+
+
+
+ UndeployGenObject
+ Undeploy all OAI 5G stack
+ yaml_files/5g_fdd_rfsimulator
+
+
+
diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml
index d1114616a8..7485b1f8ba 100644
--- a/ci-scripts/xml_files/container_5g_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim.xml
@@ -21,8 +21,8 @@
-->
- rfsim-5gnr
- Testing 5G NR RF sim - Monolithic gNB
+ rfsim-5gnr-tdd
+ Testing 5G NR RF sim - Monolithic TDD gNB
wrench
4
diff --git a/ci-scripts/xml_files/container_5g_rfsim_down.xml b/ci-scripts/xml_files/container_5g_rfsim_down.xml
index 9acc3f85a1..b369b1fad8 100644
--- a/ci-scripts/xml_files/container_5g_rfsim_down.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim_down.xml
@@ -22,7 +22,7 @@
-->
rfsim-5gnr-down
- CleanUp 5G RF - Monolithic gNB
+ CleanUp 5G RF - Monolithic TDD gNB
trash
100002
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md
index b2a7f8e30c..400559d269 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/README.md
@@ -48,8 +48,9 @@ Now pull images.
```bash
$ docker pull cassandra:2.1
+$ docker pull redis:6.0.5
$ docker pull rdefosseoai/oai-hss:latest
-$ docker pull rdefosseoai/oai-mme:latest
+$ docker pull rdefosseoai/magma-mme:latest
$ docker pull rdefosseoai/oai-spgwc:latest
$ docker pull rdefosseoai/oai-spgwu-tiny:latest
@@ -57,13 +58,15 @@ $ docker pull rdefosseoai/oai-enb:develop
$ docker pull rdefosseoai/oai-lte-ue:develop
```
+If the `redis` tag is not available, pick the newest available `6.0.x` tag at [Docker Hub Redis Tags](https://hub.docker.com/_/redis?tab=tags).
+
And **re-tag** them for tutorials' docker-compose file to work.
```bash
$ docker image tag rdefosseoai/oai-spgwc:latest oai-spgwc:latest
$ docker image tag rdefosseoai/oai-hss:latest oai-hss:latest
$ docker image tag rdefosseoai/oai-spgwu-tiny:latest oai-spgwu-tiny:latest
-$ docker image tag rdefosseoai/oai-mme:latest oai-mme:latest
+$ docker image tag rdefosseoai/magma-mme:latest magma-mme:latest
$ docker image tag rdefosseoai/oai-enb:develop oai-enb:develop
$ docker image tag rdefosseoai/oai-lte-ue:develop oai-lte-ue:develop
@@ -81,14 +84,14 @@ How to build the Traffic-Generator image is explained [here](https://github.com/
**Just `docker-compose up -d` WILL NOT WORK!**
-All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator` folder.
+All the following commands **SHALL** be run from the `ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz` folder.
## 2.1. Deploy and Configure Cassandra Database ##
It is very crutial that the Cassandra DB is fully configured before you do anything else!
```bash
-$ cd ci-scripts/yaml_files/4g_rfsimulator
+$ cd ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz
$ docker-compose up -d db_init
Creating network "rfsim4g-oai-private-net" with the default driver
Creating network "rfsim4g-oai-public-net" with the default driver
@@ -128,11 +131,12 @@ $ sudo tshark -i rfsim4g-public -f 'port 3868 or port 2123 or port 36412 or port
## 2.2. Deploy OAI CN4G containers ##
```bash
-$ docker-compose up -d oai_mme oai_spgwu trf_gen
+$ docker-compose up -d magma_mme oai_spgwu trf_gen
rfsim4g-cassandra is up-to-date
-Creating rfsim4g-trf-gen ... done
+Creating rfsim4g-trf-gen ... done
+Creating rfsim4g-redis ... done
Creating rfsim4g-oai-hss ... done
-Creating rfsim4g-oai-mme ... done
+Creating rfsim4g-magma-mme ... done
Creating rfsim4g-oai-spgwc ... done
Creating rfsim4g-oai-spgwu-tiny ... done
```
@@ -144,11 +148,12 @@ $ docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
-rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
-rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
-rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
-rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
-rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
+rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
+rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
+rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
+rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
+rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp
+rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
```
## 2.3. Deploy OAI eNB in RF simulator mode ##
@@ -165,77 +170,55 @@ $ docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
-rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
-rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
-rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
-rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
-rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
-rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
+rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
+rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
+rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
+rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
+rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
+rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp
+rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
```
-Check if the eNB connected to MME:
+Check if the eNB connected to MME: with MAGMA-MME, the logs are not pushed to `stdout` but to a file at `/var/log/mme.log`
```bash
-$ docker logs rfsim4g-oai-mme
+$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log"
...
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
+000141 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0095 Diameter identity of MME: mme.openairinterface.org with length: 24
+000142 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0130 S6a peer connection attempt 1 / 8
+000143 Fri Feb 11 09:49:29 2022 7EFFE7BE4700 DEBUG S6A tasks/s6a/s6a_peer.c :0141 Peer hss.openairinterface.org is now connected...
+000144 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000146 Fri Feb 11 09:49:29 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 214.
+000145 Fri Feb 11 09:49:29 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 146.
+000147 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 144.
+000148 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :3775 Create eNB context for assoc_id: 4121
+000149 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme.c :0121 S1AP ZMQ latency: 48.
+000150 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0536 New s1 setup request incoming from eNB-rf-sim macro eNB id: 00e01
+000151 Fri Feb 11 09:50:23 2022 7EFFE83E5700 DEBUG S1AP tasks/s1ap/s1ap_mme_handlers.c :0639 Adding eNB with enb_id :3585 to the list of served eNBs
+000152 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
+000153 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status|
+000154 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 |
+000155 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 |
+000156 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 0 |
+000157 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 |
+000158 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
+000159 Fri Feb 11 09:50:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0469 Client association changed: 0
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0101 ----------------------
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0102 SCTP Status:
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0103 assoc id .....: 675
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0104 state ........: 4
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0105 instrms ......: 2
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0106 outstrms .....: 2
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0108 fragmentation : 1452
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0109 pending data .: 0
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0110 unack data ...: 0
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0111 rwnd .........: 106496
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0112 peer info :
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0114 state ....: 2
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0116 cwnd .....: 4380
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0118 srtt .....: 0
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0120 rto ......: 3000
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0122 mtu ......: 1500
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0123 ----------------------
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0479 New connection
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0205 ----------------------
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0206 Local addresses:
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0217 - [192.168.61.3]
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0234 ----------------------
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0151 ----------------------
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0152 Peer addresses:
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0163 - [192.168.61.20]
-DEBUG SCTP enair-mme/src/sctp/sctp_common.c:0178 ----------------------
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!!
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0547 [675][44] Msg of length 51 received from port 36412, on stream 0, PPID 18
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0554 SCTP RETURNING!!
-DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:2826 Create eNB context for assoc_id: 675
-DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0361 S1-Setup-Request macroENB_ID.size 3 (should be 20)
-DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0321 New s1 setup request incoming from macro eNB id: 00e01
-DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0423 Adding eNB to the list of served eNBs
-DEBUG S1AP mme/src/s1ap/s1ap_mme_handlers.c:0438 Adding eNB id 3585 to the list of served eNBs
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0283 [44][675] Sending buffer 0x7f9394009f90 of 27 bytes on stream 0 with ppid 18
-DEBUG SCTP rc/sctp/sctp_primitives_server.c:0296 Successfully sent 27 bytes on stream 0
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
+000160 Fri Feb 11 09:50:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000161 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 1 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
+000162 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status|
+000163 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 |
+000164 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 |
+000165 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 |
+000166 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 |
+000167 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
+000168 Fri Feb 11 09:51:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================
+
+000169 Fri Feb 11 09:51:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
...
```
@@ -253,14 +236,14 @@ $ docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
rfsim4g-cassandra docker-entrypoint.sh cassa ... Up (healthy) 7000/tcp, 7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp
-rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
-rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
-rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp
-rfsim4g-oai-mme /openair-mme/bin/entrypoin ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
-rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
-rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
-rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
-Creating rfsim4g-oai-enb ... done
+rfsim4g-magma-mme /bin/bash -c /magma-mme/bi ... Up (healthy) 2123/udp, 3870/tcp, 5870/tcp
+rfsim4g-oai-enb /opt/oai-enb/bin/entrypoin ... Up (healthy) 2152/udp, 36412/udp, 36422/udp
+rfsim4g-oai-hss /openair-hss/bin/entrypoin ... Up (healthy) 5868/tcp, 9042/tcp, 9080/tcp, 9081/tcp
+rfsim4g-oai-lte-ue0 /opt/oai-lte-ue/bin/entryp ... Up (healthy) 10000/tcp
+rfsim4g-oai-spgwc /openair-spgwc/bin/entrypo ... Up (healthy) 2123/udp, 8805/udp
+rfsim4g-oai-spgwu-tiny /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
+rfsim4g-redis /bin/bash -c redis-server ... Up (healthy) 6379/tcp
+rfsim4g-trf-gen /bin/bash -c ip route add ... Up (healthy)
```
Making sure the OAI UE is connected:
@@ -268,40 +251,69 @@ Making sure the OAI UE is connected:
```bash
$ docker logs rfsim4g-oai-enb
...
-[RRC] RRCConnectionReconfiguration Encoded 1098 bits (138 bytes)
-[RRC] [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 138, UE id 617b)
-[RRC] sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB
-[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM
-[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM
-[SCTP] Successfully sent 46 bytes on stream 1 for assoc_id 676
-[RRC] [FRAME 00000][eNB][MOD 00][RNTI 617b] UE State = RRC_RECONFIGURED (default DRB, xid 0)
-[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM
-[PDCP] [FRAME 00000][eNB][MOD 00][RNTI 617b][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM
-[RRC] [eNB 0] Frame 0 CC 0 : SRB2 is now active
-[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti 617b, reconfiguring DRB 1/LCID 3
-[RRC] [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3
-[MAC] UE 0 RNTI 617b adding LC 3 idx 2 to scheduling control (total 3)
-[MAC] Added physicalConfigDedicated 0x7f98e0004950 for 0.0
-[S1AP] initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4
-[SCTP] Successfully sent 40 bytes on stream 1 for assoc_id 676
-[SCTP] Successfully sent 61 bytes on stream 1 for assoc_id 676
+7320446.555734 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] Logical Channel DL-DCCH, Generate UECapabilityEnquiry (bytes 10)
+7320446.555739 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB
+7320446.570284 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] received ueCapabilityInformation on UL-DCCH 1 from UE
+7320446.570293 [RRC] A got UE capabilities for UE bd8c
+7320446.570346 [RRC] W drx_Configuration parameter is NULL, cannot configure local UE parameters or CDRX is deactivated
+7320446.570370 [RRC] I [eNB 0] frame 0: requesting A2, A3, A4, and A5 event reporting
+7320446.570435 [RRC] I RRCConnectionReconfiguration Encoded 1146 bits (144 bytes)
+7320446.570440 [RRC] I [eNB 0] Frame 0, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes 144, UE id bd8c)
+7320446.570445 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB
+7320446.570446 [SCTP] I Successfully sent 46 bytes on stream 1 for assoc_id 4120
+7320446.570449 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action ADD LCID 2 (SRB id 2) configured with SN size 5 bits and RLC AM
+7320446.570455 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action ADD LCID 3 (DRB id 1) configured with SN size 12 bits and RLC AM
+7320446.583036 [RRC] I [FRAME 00000][eNB][MOD 00][RNTI bd8c] UE State = RRC_RECONFIGURED (default DRB, xid 0)
+7320446.583056 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][SRB 02] Action MODIFY LCID 2 RB id 2 reconfigured with SN size 5 and RLC AM
+7320446.583060 [PDCP] I [FRAME 00000][eNB][MOD 00][RNTI bd8c][DRB 01] Action MODIFY LCID 3 RB id 1 reconfigured with SN size 1 and RLC AM
+7320446.583065 [RRC] I [eNB 0] Frame 0 CC 0 : SRB2 is now active
+7320446.583067 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete from UE rnti bd8c, reconfiguring DRB 1/LCID 3
+7320446.583070 [RRC] I [eNB 0] Frame 0 : Logical Channel UL-DCCH, Received LTE_RRCConnectionReconfigurationComplete, reconfiguring DRB 1/LCID 3
+7320446.583074 [MAC] I UE 0 RNTI bd8c adding LC 3 idx 2 to scheduling control (total 3)
+7320446.583077 [MAC] I Added physicalConfigDedicated 0x7fd18c46be50 for 0.0
+7320446.583095 [S1AP] I initial_ctxt_resp_p: e_rab ID 5, enb_addr 192.168.61.20, SIZE 4
+7320446.583150 [SCTP] I Successfully sent 40 bytes on stream 1 for assoc_id 4120
+7320446.595495 [SCTP] I Successfully sent 61 bytes on stream 1 for assoc_id 4120
+7320446.774197 [SCTP] I Found data for descriptor 103
+7320446.774227 [SCTP] I [4120][103] Msg of length 53 received, on stream 1, PPID 18
+7320446.774295 [RRC] I [eNB 0] Received S1AP_DOWNLINK_NAS: ue_initial_id 0, eNB_ue_s1ap_id 4527568
+7320446.774316 [RRC] I sent RRC_DCCH_DATA_REQ to TASK_PDCP_ENB
...
```
-On the MME:
+On the MME: be patient, the statistics display update is slow!
```bash
-$ docker logs rfsim4g-oai-mme
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0039 ======================================= STATISTICS ============================================
+$ docker exec rfsim4g-magma-mme /bin/bash -c "cat /var/log/mme.log"
+000413 Fri Feb 11 09:52:52 2022 7EFFE8BE6700 INFO GTPv2- lib/gtpv2-c/nwgtpv2c-0.11/src/Nw:2376 Stopped active timer 0x2 for info 0x0x60700001a9b0!
+000414 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000415 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0083 MME APP ZMQ latency: 172.
+000416 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 INFO MME-AP tasks/mme_app/mme_app_main.c :0137 Received S11 MODIFY BEARER RESPONSE from SPGW
+000417 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_main.c :0150 S11 MODIFY BEARER RESPONSE local S11 teid = 1
+000418 Fri Feb 11 09:52:52 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000419 Fri Feb 11 09:53:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000420 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0042 | Current Status| Added since last display| Removed since last display |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0048 Connected eNBs | 1 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0054 Attached UEs | 1 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0060 Connected UEs | 1 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0066 Default Bearers| 0 | 0 | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0072 S1-U Bearers | 0 | 0 | 0 |
+000421 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status|
+000422 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 0 |
+000423 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 0 |
+000424 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 |
+000425 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 0 |
+000426 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 0 |
-DEBUG MME-AP src/mme_app/mme_app_statistics.c:0075 ======================================= STATISTICS ============================================
+000427 Fri Feb 11 09:53:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================
+
+000428 Fri Feb 11 09:54:28 2022 7EFFEA3E9700 DEBUG MME-AP tasks/mme_app/mme_app_state_mana:0097 Inside get_state with read_from_db 0
+000429 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0049 ======================================= STATISTICS ============================================
+
+000430 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0050 | Current Status|
+000431 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0053 Attached UEs | 1 |
+000432 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0056 Connected UEs | 1 |
+000433 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0059 Connected eNBs | 1 |
+000434 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0062 Default Bearers| 1 |
+000435 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0065 S1-U Bearers | 1 |
+
+000436 Fri Feb 11 09:54:28 2022 7EFFEC3ED700 DEBUG SERVIC tasks/service303/service303_mme_:0070 ======================================= STATISTICS ============================================
```
On the LTE UE:
@@ -377,16 +389,18 @@ Stopping rfsim4g-oai-lte-ue0 ... done
Stopping rfsim4g-oai-enb ... done
Stopping rfsim4g-oai-spgwu-tiny ... done
Stopping rfsim4g-oai-spgwc ... done
-Stopping rfsim4g-oai-mme ... done
+Stopping rfsim4g-magma-mme ... done
Stopping rfsim4g-oai-hss ... done
+Stopping rfsim4g-redis ... done
Stopping rfsim4g-trf-gen ... done
Stopping rfsim4g-cassandra ... done
Removing rfsim4g-oai-lte-ue0 ... done
Removing rfsim4g-oai-enb ... done
Removing rfsim4g-oai-spgwu-tiny ... done
Removing rfsim4g-oai-spgwc ... done
-Removing rfsim4g-oai-mme ... done
+Removing rfsim4g-magma-mme ... done
Removing rfsim4g-oai-hss ... done
+Removing rfsim4g-redis ... done
Removing rfsim4g-trf-gen ... done
Removing rfsim4g-cassandra ... done
Removing network rfsim4g-oai-private-net
@@ -443,19 +457,23 @@ My 1st UE IMSI is an aggregation of `MCC`, `MNC`, `SHORT_IMSI`.
## 5.2. PLMN and TAI ##
-in MME config:
+in MME config, in the docker-compose there is not much besides REALM fields:
```yaml
+ TZ: Europe/Paris
REALM: openairinterface.org
-..
- MCC: '208'
- MNC: '96'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
+ PREFIX: /openair-mme/etc
+ HSS_HOSTNAME: hss
+ HSS_FQDN: hss.openairinterface.org
+ HSS_REALM: openairinterface.org
MME_FQDN: mme.openairinterface.org
+ FEATURES: mme_oai
+```
+
+Everything is hard-coded in the `mme.conf` that is mounted as a volume: look for instances of
+
+```
+MCC="208" ; MNC="96"; TAC = "1";
```
in SPGW-C/-U configs:
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
index e852643ab9..b15e794c10 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/docker-compose.yml
@@ -58,57 +58,45 @@ services:
timeout: 5s
retries: 5
- oai_mme:
- image: oai-mme:latest
- container_name: rfsim4g-oai-mme
+ redis:
+ image: redis:6.0.5
+ container_name: rfsim4g-redis
privileged: true
- depends_on: [oai_hss]
+ networks:
+ public_net:
+ ipv4_address: 192.168.61.6
+ volumes:
+ - ./redis_extern.conf:/usr/local/etc/redis/redis.conf
+ entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
+ healthcheck:
+ test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ magma_mme:
+ image: magma-mme:latest
+ container_name: rfsim4g-magma-mme
+ hostname: mme
+ privileged: true
+ depends_on: [oai_hss, redis]
networks:
public_net:
ipv4_address: 192.168.61.3
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
PREFIX: /openair-mme/etc
- INSTANCE: 1
- PID_DIRECTORY: /var/run
- HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
- MCC: '208'
- MNC: '96'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
MME_FQDN: mme.openairinterface.org
- MME_S6A_IP_ADDR: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S1_MME: eth0
- MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S11: eth0
- MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S10: lo
- MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
- OUTPUT: CONSOLE
- SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
- PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
- PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
- MCC_SGW_0: '208'
- MNC3_SGW_0: '096'
- TAC_LB_SGW_0: '01'
- TAC_HB_SGW_0: '00'
- MCC_MME_0: '208'
- MNC3_MME_0: '096'
- TAC_LB_MME_0: '02'
- TAC_HB_MME_0: '00'
- MCC_MME_1: '208'
- MNC3_MME_1: '096'
- TAC_LB_MME_1: '03'
- TAC_HB_MME_1: '00'
- TAC_LB_SGW_TEST_0: '03'
- TAC_HB_SGW_TEST_0: '00'
- SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
+ FEATURES: mme_oai
+ volumes:
+ - ./mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt
+ - ./mme.conf:/magma-mme/etc/mme.conf
+ - ./entrypoint.sh:/magma-mme/bin/entrypoint.sh
+ entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh"
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
@@ -118,7 +106,7 @@ services:
oai_spgwc:
image: oai-spgwc:latest
privileged: true
- depends_on: [oai_mme]
+ depends_on: [magma_mme]
container_name: rfsim4g-oai-spgwc
networks:
public_net:
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh
new file mode 100755
index 0000000000..24960e215d
--- /dev/null
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/entrypoint.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+INSTANCE=1
+PREFIX='/magma-mme/etc'
+MY_REALM='openairinterface.org'
+
+declare -A MME_CONF
+
+pushd $PREFIX
+MME_CONF[@MME_S6A_IP_ADDR@]="192.168.61.3"
+MME_CONF[@INSTANCE@]=$INSTANCE
+MME_CONF[@PREFIX@]=$PREFIX
+MME_CONF[@REALM@]=$MY_REALM
+MME_CONF[@MME_FQDN@]="mme.${MME_CONF[@REALM@]}"
+MME_CONF[@HSS_HOSTNAME@]='hss'
+MME_CONF[@HSS_FQDN@]="${MME_CONF[@HSS_HOSTNAME@]}.${MME_CONF[@REALM@]}"
+MME_CONF[@HSS_IP_ADDR@]="192.168.61.2"
+
+cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf
+
+for K in "${!MME_CONF[@]}"; do
+ egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g"
+ ret=$?;[[ ret -ne 0 ]] && echo "Could not replace $K with ${MME_CONF[$K]}"
+done
+
+sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf
+sed -i -e "s@bind: 127.0.0.1@bind: 192.168.61.6@" /etc/magma/redis.yml
+# Generate freeDiameter certificate
+popd
+cd /magma-mme/scripts
+./check_mme_s6a_certificate $PREFIX mme.${MME_CONF[@REALM@]}
+
+cd /magma-mme
+nohup /magma-mme/bin/sctpd > /var/log/sctpd.log 2>&1 &
+sleep 5
+/magma-mme/bin/oai_mme -c /magma-mme/etc/mme.conf
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf
new file mode 100644
index 0000000000..4f491cc63d
--- /dev/null
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme.conf
@@ -0,0 +1,134 @@
+# generated by generate_mme_config_script.py
+MME :
+{
+ REALM = "openairinterface.org"
+ PID_DIRECTORY = "/var/run";
+ MAXENB = 8; # power of 2
+ MAXUE = 16; # power of 2
+ RELATIVE_CAPACITY = 10;
+
+ EMERGENCY_ATTACH_SUPPORTED = "no";
+ UNAUTHENTICATED_IMSI_SUPPORTED = "no";
+
+ # EPS network feature support
+ EPS_NETWORK_FEATURE_SUPPORT_IMS_VOICE_OVER_PS_SESSION_IN_S1 = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_EMERGENCY_BEARER_SERVICES_IN_S1_MODE = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_LOCATION_SERVICES_VIA_EPC = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_EXTENDED_SERVICE_REQUEST = "no"; # DO NOT CHANGE
+
+ # Display statistics about whole system (expressed in seconds)
+ MME_STATISTIC_TIMER = 10;
+ IP_CAPABILITY = "IPV4"; # UE PDN_TYPE
+ USE_STATELESS = "";
+
+ INTERTASK_INTERFACE :
+ {
+ # max queue size per task
+ ITTI_QUEUE_SIZE = 2000000;
+ };
+
+ S6A :
+ {
+ S6A_CONF = "/magma-mme/etc/mme_fd.conf"; # YOUR MME freeDiameter config file path
+ HSS_HOSTNAME = "hss.openairinterface.org";
+ HSS_REALM = "openairinterface.org";
+ };
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 8;
+ SCTP_OUTSTREAMS = 8;
+ };
+
+ # ------- S1AP definitions
+ S1AP :
+ {
+ # outcome drop timer value (seconds)
+ S1AP_OUTCOME_TIMER = 10;
+ };
+
+ # ------- MME served GUMMEIs
+ GUMMEI_LIST = (
+ { MCC="208" ; MNC="96"; MME_GID="32768" ; MME_CODE="3"; }
+ );
+
+ # ------- MME served TAIs
+ TAI_LIST = (
+ {MCC="208" ; MNC="96"; TAC = "1"; }
+ );
+
+ TAC_LIST = (
+ {MCC="208" ; MNC="96"; TAC = "1"; }
+ );
+
+ CSFB :
+ {
+ NON_EPS_SERVICE_CONTROL = "OFF";
+ CSFB_MCC = "208";
+ CSFB_MNC = "96";
+ LAC = "1";
+ };
+ NAS :
+ {
+ ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "EIA2" , "EIA1" , "EIA0" ];
+ ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "EEA0" , "EEA1" , "EEA2" ];
+ T3402 = 1 # in minutes (default is 12 minutes)
+ T3412 = 54 # in minutes (default is 54 minutes, network dependent)
+ T3422 = 6 # in seconds (default is 6s)
+ T3450 = 6 # in seconds (default is 6s)
+ T3460 = 6 # in seconds (default is 6s)
+ T3470 = 6 # in seconds (default is 6s)
+ T3485 = 8 # UNUSED in seconds (default is 8s)
+ T3486 = 8 # UNUSED in seconds (default is 8s)
+ T3489 = 4 # UNUSED in seconds (default is 4s)
+ T3495 = 8 # UNUSED in seconds (default is 8s)
+ };
+
+ SGS :
+ {
+ TS6_1 = 10 # in seconds (default is 10s)
+ TS8 = 4 # in seconds (default is 4s)
+ TS9 = 2 # in seconds (default is 4s)
+ TS10 = 4 # in seconds (default is 4s)
+ TS13 = 4 # in seconds (default is 4s)
+ };
+
+ NETWORK_INTERFACES :
+ {
+ MME_INTERFACE_NAME_FOR_S1_MME = "eth0";
+ MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.61.3/24";
+ MME_INTERFACE_NAME_FOR_S11_MME = "eth0";
+ MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.61.3/24";
+ MME_PORT_FOR_S11_MME = 2123;
+ };
+
+ LOGGING :
+ {
+ OUTPUT = "CONSOLE";
+ THREAD_SAFE = "no";
+ COLOR = "no";
+
+ SCTP_LOG_LEVEL = "ERROR";
+ GTPV1U_LOG_LEVEL = "INFO";
+ SPGW_APP_LOG_LEVEL = "INFO";
+ UDP_LOG_LEVEL = "INFO";
+ S1AP_LOG_LEVEL = "DEBUG";
+ NAS_LOG_LEVEL = "INFO";
+ MME_APP_LOG_LEVEL = "DEBUG";
+ GTPV2C_LOG_LEVEL = "INFO";
+ S11_LOG_LEVEL = "DEBUG";
+ S6A_LOG_LEVEL = "DEBUG";
+ UTIL_LOG_LEVEL = "INFO";
+ MSC_LOG_LEVEL = "ERROR";
+ ITTI_LOG_LEVEL = "ERROR";
+ MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR";
+ ASN1_VERBOSITY = "INFO";
+ };
+
+ S-GW :
+ {
+ SGW_IPV4_ADDRESS_FOR_S11 = "192.168.61.4";
+ };
+};
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf
new file mode 100644
index 0000000000..6f87ed8c2b
--- /dev/null
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf
@@ -0,0 +1,169 @@
+# -------- Local ---------
+
+# Uncomment if the framework cannot resolv it.
+Identity = "@MME_FQDN@";
+Realm = "@REALM@";
+
+# TLS configuration (see previous section)
+TLS_Cred = "@PREFIX@/freeDiameter/mme.cert.pem",
+ "@PREFIX@/freeDiameter/mme.key.pem";
+TLS_CA = "@PREFIX@/freeDiameter/mme.cacert.pem";
+
+# Disable use of TCP protocol (only listen and connect in SCTP)
+# Default : TCP enabled
+No_SCTP;
+
+# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option.
+# Prefer TCP instead of SCTP for establishing new connections.
+# This setting may be overwritten per peer in peer configuration blocs.
+# Default : SCTP is attempted first.
+Prefer_TCP;
+
+
+No_IPv6;
+
+# Overwrite the number of SCTP streams. This value should be kept low,
+# especially if you are using TLS over SCTP, because it consumes a lot of
+# resources in that case. See tickets 19 and 27 for some additional details on
+# this.
+# Limit the number of SCTP streams
+SCTP_streams = 3;
+
+
+# By default, freeDiameter acts as a Diameter Relay Agent by forwarding all
+# messages it cannot handle locally. This parameter disables this behavior.
+NoRelay;
+
+# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed
+# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the
+# CER/CEA exchange on a dedicated secure port.
+# This parameter only affects outgoing connections.
+# The setting can be also defined per-peer (see Peers configuration section).
+# Default: use RFC6733 method with separate port for TLS.
+
+#TLS_old_method;
+
+AppServThreads = 4;
+
+# Specify the addresses on which to bind the listening server. This must be
+# specified if the framework is unable to auto-detect these addresses, or if the
+# auto-detected values are incorrect. Note that the list of addresses is sent
+# in CER or CEA message, so one should pay attention to this parameter if some
+# adresses should be kept hidden.
+ListenOn = "@MME_S6A_IP_ADDR@";
+
+Port = 3870;
+SecPort = 5870;
+
+# -------- Extensions ---------
+
+# Uncomment (and create rtd.conf) to specify routing table for this peer.
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx" : "rtd.conf";
+
+#LoadExtension = "/usr/local/lib/freeDiameter/_sample.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_acct.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_diameap.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_radgw.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_redirect.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_sip.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_interactive.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_monitor.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_dumps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_timings.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_rt.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_CreditControl.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_CxDx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Gx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_NAS.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Ro.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_S6mS6n.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_SLh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sd.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_T4.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Tsp.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_3gpp.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_starent.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_eap.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_legacy_xml.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6a.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6i.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_nas_mipv6.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_nasreq.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_sip.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_busypeers.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_ereg.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_ignore_dh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_load_balance.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_randomize.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_redirect.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_acct.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_app.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_hss.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_netemul.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_rt_any.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_sip.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rf.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
+
+
+# -------- Peers ---------
+
+# The framework will actively attempt to establish and maintain a connection
+# with the peers listed here.
+# For only accepting incoming connections, see the acl_wl.fx extension.
+
+# ConnectPeer
+# Declare a remote peer to which this peer must maintain a connection.
+# In addition, this allows specifying non-default parameters for this peer only
+# (for example disable SCTP with this peer, or use RFC3588-flavour TLS).
+# Note that by default, if a peer is not listed as a ConnectPeer entry, an
+# incoming connection from this peer will be rejected. If you want to accept
+# incoming connections from other peers, see the acl_wl.fdx? extension which
+# allows exactly this.
+
+ConnectPeer= "@HSS_FQDN@" { ConnectTo = "@HSS_IP_ADDR@"; No_SCTP ; No_IPv6; Prefer_TCP; No_TLS; port = 3868;};
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf
new file mode 100644
index 0000000000..1ee9dd9a78
--- /dev/null
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_05MHz/redis_extern.conf
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2016-present, Facebook, Inc.
+# All rights reserved.
+#
+# This source code is licensed under the BSD-style license found in the
+# LICENSE file in the root directory of this source tree. An additional grant
+# of patent rights can be found in the PATENTS file in the same directory.
+
+# Jinja template for Redis configuration
+# See the default config file for options and explanations:
+# https://github.com/antirez/redis/blob/unstable/redis.conf
+
+# TODO: make sensible, production-aware config decisions
+
+bind 192.168.61.6
+port 6380
+
+daemonize no
+loglevel notice
+
+timeout 0
+databases 1
+
+dbfilename redis_dump.rdb
+dir /data
+
+# Save the DB on disk
+
+save 900 1
+
+save 300 10
+
+save 60 1000
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
index 4c1ceb424a..e1e992c94c 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_10MHz/docker-compose.yml
@@ -58,57 +58,45 @@ services:
timeout: 5s
retries: 5
- oai_mme:
- image: oai-mme:latest
- container_name: rfsim4g-oai-mme
+ redis:
+ image: redis:6.0.5
+ container_name: rfsim4g-redis
privileged: true
- depends_on: [oai_hss]
+ networks:
+ public_net:
+ ipv4_address: 192.168.61.6
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf
+ entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
+ healthcheck:
+ test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ magma_mme:
+ image: magma-mme:latest
+ container_name: rfsim4g-magma-mme
+ hostname: mme
+ privileged: true
+ depends_on: [oai_hss, redis]
networks:
public_net:
ipv4_address: 192.168.61.3
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
PREFIX: /openair-mme/etc
- INSTANCE: 1
- PID_DIRECTORY: /var/run
- HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
- MCC: '208'
- MNC: '96'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
MME_FQDN: mme.openairinterface.org
- MME_S6A_IP_ADDR: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S1_MME: eth0
- MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S11: eth0
- MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S10: lo
- MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
- OUTPUT: CONSOLE
- SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
- PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
- PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
- MCC_SGW_0: '208'
- MNC3_SGW_0: '096'
- TAC_LB_SGW_0: '01'
- TAC_HB_SGW_0: '00'
- MCC_MME_0: '208'
- MNC3_MME_0: '096'
- TAC_LB_MME_0: '02'
- TAC_HB_MME_0: '00'
- MCC_MME_1: '208'
- MNC3_MME_1: '096'
- TAC_LB_MME_1: '03'
- TAC_HB_MME_1: '00'
- TAC_LB_SGW_TEST_0: '03'
- TAC_HB_SGW_TEST_0: '00'
- SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
+ FEATURES: mme_oai
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt
+ - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf
+ - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh
+ entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh"
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
@@ -118,7 +106,7 @@ services:
oai_spgwc:
image: oai-spgwc:latest
privileged: true
- depends_on: [oai_mme]
+ depends_on: [magma_mme]
container_name: rfsim4g-oai-spgwc
networks:
public_net:
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
index 4a61181afb..ad665813f2 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_fdd_20MHz/docker-compose.yml
@@ -58,57 +58,45 @@ services:
timeout: 5s
retries: 5
- oai_mme:
- image: oai-mme:latest
- container_name: rfsim4g-oai-mme
+ redis:
+ image: redis:6.0.5
+ container_name: rfsim4g-redis
privileged: true
- depends_on: [oai_hss]
+ networks:
+ public_net:
+ ipv4_address: 192.168.61.6
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf
+ entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
+ healthcheck:
+ test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ magma_mme:
+ image: magma-mme:latest
+ container_name: rfsim4g-magma-mme
+ hostname: mme
+ privileged: true
+ depends_on: [oai_hss, redis]
networks:
public_net:
ipv4_address: 192.168.61.3
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
PREFIX: /openair-mme/etc
- INSTANCE: 1
- PID_DIRECTORY: /var/run
- HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
- MCC: '208'
- MNC: '96'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
MME_FQDN: mme.openairinterface.org
- MME_S6A_IP_ADDR: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S1_MME: eth0
- MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S11: eth0
- MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S10: lo
- MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
- OUTPUT: CONSOLE
- SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
- PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
- PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
- MCC_SGW_0: '208'
- MNC3_SGW_0: '096'
- TAC_LB_SGW_0: '01'
- TAC_HB_SGW_0: '00'
- MCC_MME_0: '208'
- MNC3_MME_0: '096'
- TAC_LB_MME_0: '02'
- TAC_HB_MME_0: '00'
- MCC_MME_1: '208'
- MNC3_MME_1: '096'
- TAC_LB_MME_1: '03'
- TAC_HB_MME_1: '00'
- TAC_LB_SGW_TEST_0: '03'
- TAC_HB_SGW_TEST_0: '00'
- SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
+ FEATURES: mme_oai
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt
+ - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf
+ - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh
+ entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh"
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
@@ -118,7 +106,7 @@ services:
oai_spgwc:
image: oai-spgwc:latest
privileged: true
- depends_on: [oai_mme]
+ depends_on: [magma_mme]
container_name: rfsim4g-oai-spgwc
networks:
public_net:
diff --git a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
index 3424780791..ffa92bac49 100644
--- a/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
+++ b/ci-scripts/yaml_files/4g_rfsimulator_tdd_05MHz/docker-compose.yml
@@ -58,57 +58,45 @@ services:
timeout: 5s
retries: 5
- oai_mme:
- image: oai-mme:latest
- container_name: rfsim4g-oai-mme
+ redis:
+ image: redis:6.0.5
+ container_name: rfsim4g-redis
privileged: true
- depends_on: [oai_hss]
+ networks:
+ public_net:
+ ipv4_address: 192.168.61.6
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/redis_extern.conf:/usr/local/etc/redis/redis.conf
+ entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
+ healthcheck:
+ test: /bin/bash -c "redis-cli -h 192.168.61.6 -p 6380 ping"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ magma_mme:
+ image: magma-mme:latest
+ container_name: rfsim4g-magma-mme
+ hostname: mme
+ privileged: true
+ depends_on: [oai_hss, redis]
networks:
public_net:
ipv4_address: 192.168.61.3
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
PREFIX: /openair-mme/etc
- INSTANCE: 1
- PID_DIRECTORY: /var/run
- HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
- MCC: '208'
- MNC: '96'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
MME_FQDN: mme.openairinterface.org
- MME_S6A_IP_ADDR: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S1_MME: eth0
- MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S11: eth0
- MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S10: lo
- MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
- OUTPUT: CONSOLE
- SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
- PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
- PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
- MCC_SGW_0: '208'
- MNC3_SGW_0: '096'
- TAC_LB_SGW_0: '01'
- TAC_HB_SGW_0: '00'
- MCC_MME_0: '208'
- MNC3_MME_0: '096'
- TAC_LB_MME_0: '02'
- TAC_HB_MME_0: '00'
- MCC_MME_1: '208'
- MNC3_MME_1: '096'
- TAC_LB_MME_1: '03'
- TAC_HB_MME_1: '00'
- TAC_LB_SGW_TEST_0: '03'
- TAC_HB_SGW_TEST_0: '00'
- SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
+ FEATURES: mme_oai
+ volumes:
+ - ../4g_rfsimulator_fdd_05MHz/mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt
+ - ../4g_rfsimulator_fdd_05MHz/mme.conf:/magma-mme/etc/mme.conf
+ - ../4g_rfsimulator_fdd_05MHz/entrypoint.sh:/magma-mme/bin/entrypoint.sh
+ entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh"
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
@@ -118,7 +106,7 @@ services:
oai_spgwc:
image: oai-spgwc:latest
privileged: true
- depends_on: [oai_mme]
+ depends_on: [magma_mme]
container_name: rfsim4g-oai-spgwc
networks:
public_net:
diff --git a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
index 6a39f2147e..74a23905f0 100644
--- a/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_f1_rfsimulator/docker-compose.yaml
@@ -241,12 +241,12 @@ services:
NSSAI_SD1: 112233
AMF_IP_ADDRESS: 192.168.71.132
GNB_NGA_IF_NAME: eth0
- GNB_NGA_IP_ADDRESS: 192.168.71.136
+ GNB_NGA_IP_ADDRESS: 192.168.71.140
GNB_NGU_IF_NAME: eth0
- GNB_NGU_IP_ADDRESS: 192.168.71.136
+ GNB_NGU_IP_ADDRESS: 192.168.71.140
F1_IF_NAME: eth0
- F1_CU_IP_ADDRESS: 192.168.71.136
- F1_DU_IP_ADDRESS: 192.168.71.138
+ F1_CU_IP_ADDRESS: 192.168.71.140
+ F1_DU_IP_ADDRESS: 192.168.71.142
F1_CU_D_PORT: 2153
F1_DU_D_PORT: 2153
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
@@ -254,7 +254,7 @@ services:
- oai-ext-dn
networks:
public_net:
- ipv4_address: 192.168.71.136
+ ipv4_address: 192.168.71.140
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
@@ -277,12 +277,12 @@ services:
NSSAI_SD1: 112233
AMF_IP_ADDRESS: 192.168.71.132
GNB_NGA_IF_NAME: eth0
- GNB_NGA_IP_ADDRESS: 192.168.71.138
+ GNB_NGA_IP_ADDRESS: 192.168.71.142
GNB_NGU_IF_NAME: eth0
- GNB_NGU_IP_ADDRESS: 192.168.71.138
+ GNB_NGU_IP_ADDRESS: 192.168.71.142
F1_IF_NAME: eth0
- F1_CU_IP_ADDRESS: 192.168.71.136
- F1_DU_IP_ADDRESS: 192.168.71.138
+ F1_CU_IP_ADDRESS: 192.168.71.140
+ F1_DU_IP_ADDRESS: 192.168.71.142
F1_CU_D_PORT: 2153
F1_DU_D_PORT: 2153
USE_ADDITIONAL_OPTIONS: --sa --rfsim --log_config.global_log_options level,nocolor,time
@@ -290,7 +290,7 @@ services:
- oai-cu
networks:
public_net:
- ipv4_address: 192.168.71.138
+ ipv4_address: 192.168.71.142
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
@@ -301,7 +301,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
- RFSIMULATOR: 192.168.71.138
+ RFSIMULATOR: 192.168.71.142
FULL_IMSI: '208990100001100'
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
@@ -313,7 +313,7 @@ services:
- oai-du
networks:
public_net:
- ipv4_address: 192.168.71.137
+ ipv4_address: 192.168.71.150
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh
new file mode 100755
index 0000000000..8bfdee2aac
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/amf-healthcheck.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+AMF_PORT_FOR_NGAP=38412
+AMF_PORT_FOR_N11_HTTP=80
+AMF_IP_NGAP_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_NGAP | grep inet | awk {'print $2'})
+AMF_IP_N11_INTERFACE=$(ifconfig $AMF_INTERFACE_NAME_FOR_N11 | grep inet | awk {'print $2'})
+N2_PORT_STATUS=$(netstat -Snpl | grep -o "$AMF_IP_NGAP_INTERFACE:$AMF_PORT_FOR_NGAP")
+N11_PORT_STATUS=$(netstat -tnpl | grep -o "$AMF_IP_N11_INTERFACE:$AMF_PORT_FOR_N11_HTTP")
+#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
+NB_UNREPLACED_AT=`cat /openair-amf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: configuration file is not configured properly"
+fi
+
+if [[ -z $N2_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: N2 SCTP port $AMF_PORT_FOR_NGAP is not listening"
+fi
+
+if [[ -z $N11_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: N11/SBI TCP/HTTP port $AMF_PORT_FOR_N11_HTTP is not listening"
+fi
+
+#host="${MYSQL_SERVER}"
+#user="${MYSQL_USER:-root}"
+#export MYSQL_PWD="${MYSQL_PASS}"
+
+#args=(
+# -h"$host"
+# -u"$user"
+# --silent
+#)
+
+#if ! command -v mysql &> /dev/null; then
+# echo "Installing mysql command"
+# apt update
+# apt-get -y install mysql-client
+#else
+# if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
+# database_check=$(mysql -h$host -u$user -D oai_db --silent -e "SELECT * FROM users;")
+# if [[ -z $database_check ]]; then
+# echo "Healthcheck error: oai_db not populated"
+# STATUS=1
+# fi
+# STATUS=0
+# else
+# echo "Healthcheck error: Mysql port inactive"
+# STATUS=1
+# fi
+#fi
+
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml
new file mode 100644
index 0000000000..3e46adb9e7
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/docker-compose.yaml
@@ -0,0 +1,298 @@
+version: '3.8'
+services:
+ oai-nrf:
+ container_name: "rfsim5g-oai-nrf"
+ image: oai-nrf:latest
+ environment:
+ - NRF_INTERFACE_NAME_FOR_SBI=eth0
+ - NRF_INTERFACE_PORT_FOR_SBI=80
+ - NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
+ - NRF_API_VERSION=v1
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.130
+ volumes:
+ - ./nrf-healthcheck.sh:/openair-nrf/bin/nrf-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-nrf/bin/nrf-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ mysql:
+ container_name: "rfsim5g-mysql"
+ image: mysql:5.7
+ volumes:
+ - ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
+ - ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
+ environment:
+ - TZ=Europe/Paris
+ - MYSQL_DATABASE=oai_db
+ - MYSQL_USER=test
+ - MYSQL_PASSWORD=test
+ - MYSQL_ROOT_PASSWORD=linux
+ healthcheck:
+ test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.131
+ oai-amf:
+ container_name: "rfsim5g-oai-amf"
+ image: oai-amf:latest
+ environment:
+ - TZ=Europe/paris
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ - MCC=208
+ - MNC=99
+ - REGION_ID=128
+ - AMF_SET_ID=1
+ - SERVED_GUAMI_MCC_0=208
+ - SERVED_GUAMI_MNC_0=99
+ - SERVED_GUAMI_REGION_ID_0=128
+ - SERVED_GUAMI_AMF_SET_ID_0=1
+ - SERVED_GUAMI_MCC_1=460
+ - SERVED_GUAMI_MNC_1=11
+ - SERVED_GUAMI_REGION_ID_1=10
+ - SERVED_GUAMI_AMF_SET_ID_1=1
+ - PLMN_SUPPORT_MCC=208
+ - PLMN_SUPPORT_MNC=99
+ - PLMN_SUPPORT_TAC=0x0001
+ - SST_0=1
+ - SD_0=1
+ - SST_1=1
+ - SD_1=12
+ - AMF_INTERFACE_NAME_FOR_NGAP=eth0
+ - AMF_INTERFACE_NAME_FOR_N11=eth0
+ - SMF_INSTANCE_ID_0=1
+ - SMF_FQDN_0=oai-smf
+ - SMF_IPV4_ADDR_0=0.0.0.0
+ - SMF_HTTP_VERSION_0=v1
+ - SELECTED_0=true
+ - SMF_INSTANCE_ID_1=2
+ - SMF_FQDN_1=oai-smf
+ - SMF_IPV4_ADDR_1=0.0.0.0
+ - SMF_HTTP_VERSION_1=v1
+ - SELECTED_1=false
+ - MYSQL_SERVER=192.168.71.131
+ - MYSQL_USER=root
+ - MYSQL_PASS=linux
+ - MYSQL_DB=oai_db
+ - OPERATOR_KEY=c42449363bbad02b66d16bc975d77cc1
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NF_REGISTRATION=yes
+ - SMF_SELECTION=yes
+ - USE_FQDN_DNS=yes
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - EXTERNAL_AUSF=no
+ - AUSF_IPV4_ADDRESS=0.0.0.0
+ - AUSF_PORT=80
+ - AUSF_API_VERSION=v1
+ - AUSF_FQDN=localhost
+ depends_on:
+ - oai-nrf
+ - mysql
+ volumes:
+ - ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
+ interval: 10s
+ timeout: 15s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.132
+ oai-smf:
+ container_name: "rfsim5g-oai-smf"
+ image: oai-smf:latest
+ environment:
+ - TZ=Europe/Paris
+ - INSTANCE=0
+ - PID_DIRECTORY=/var/run
+ - SMF_INTERFACE_NAME_FOR_N4=eth0
+ - SMF_INTERFACE_NAME_FOR_SBI=eth0
+ - SMF_INTERFACE_PORT_FOR_SBI=80
+ - SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
+ - SMF_API_VERSION=v1
+ - DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
+ - DEFAULT_DNS_SEC_IPV4_ADDRESS=4.4.4.4
+ - AMF_IPV4_ADDRESS=0.0.0.0
+ - AMF_PORT=80
+ - AMF_API_VERSION=v1
+ - AMF_FQDN=oai-amf
+ - UDM_IPV4_ADDRESS=127.0.0.1
+ - UDM_PORT=80
+ - UDM_API_VERSION=v1
+ - UDM_FQDN=localhost
+ - UPF_IPV4_ADDRESS=192.168.71.134
+ - UPF_FQDN_0=oai-spgwu
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - REGISTER_NRF=yes
+ - DISCOVER_UPF=yes
+ - USE_FQDN_DNS=yes
+ - DNN_NI0=oai
+ - DNN_NI2=oai.ipv4
+ depends_on:
+ - oai-nrf
+ - oai-amf
+ volumes:
+ - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.133
+ oai-spgwu:
+ container_name: "rfsim5g-oai-spgwu"
+ image: oai-spgwu-tiny:latest
+ environment:
+ - TZ=Europe/Paris
+ - PID_DIRECTORY=/var/run
+ - SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP=eth0
+ - SGW_INTERFACE_NAME_FOR_SX=eth0
+ - PGW_INTERFACE_NAME_FOR_SGI=eth0
+ - NETWORK_UE_NAT_OPTION=yes
+ - NETWORK_UE_IP=12.1.1.0/24
+ - SPGWC0_IP_ADDRESS=192.168.71.133
+ - BYPASS_UL_PFCP_RULES=no
+ - MCC=208
+ - MNC=99
+ - MNC03=099
+ - TAC=1
+ - GTP_EXTENSION_HEADER_PRESENT=yes
+ - GW_ID=1
+ - REALM=openairinterface.org
+ - ENABLE_5G_FEATURES=yes
+ - REGISTER_NRF=yes
+ - USE_FQDN_NRF=yes
+ - UPF_FQDN_5G=oai-spgwu
+ - NRF_IPV4_ADDRESS=192.168.71.130
+ - NRF_PORT=80
+ - NRF_API_VERSION=v1
+ - NRF_FQDN=oai-nrf
+ - NSSAI_SST_0=1
+ - NSSAI_SD_0=1
+ - DNN_0=oai
+ depends_on:
+ - oai-nrf
+ - oai-smf
+ cap_add:
+ - NET_ADMIN
+ - SYS_ADMIN
+ cap_drop:
+ - ALL
+ privileged: true
+ volumes:
+ - ./spgwu-healthcheck.sh:/openair-spgwu-tiny/bin/spgwu-healthcheck.sh
+ healthcheck:
+ test: /bin/bash -c "/openair-spgwu-tiny/bin/spgwu-healthcheck.sh"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.134
+ traffic_net:
+ ipv4_address: 192.168.72.134
+ oai-ext-dn:
+ image: ubuntu:bionic
+ privileged: true
+ container_name: rfsim5g-oai-ext-dn
+ entrypoint: /bin/bash -c \
+ "apt update; apt install -y procps iptables iproute2 iperf iputils-ping;"\
+ "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
+ "ip route add 12.1.1.0/24 via 192.168.72.134 dev eth0; sleep infinity"
+ depends_on:
+ - oai-spgwu
+ networks:
+ traffic_net:
+ ipv4_address: 192.168.72.135
+ healthcheck:
+ test: /bin/bash -c "ping -c 2 192.168.72.134"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ oai-gnb:
+ image: oai-gnb:develop
+ privileged: true
+ container_name: rfsim5g-oai-gnb
+ environment:
+ RFSIMULATOR: server
+ USE_SA_FDD_MONO: 'yes'
+ GNB_NAME: gnb-rfsim
+ TAC: 1
+ MCC: '208'
+ MNC: '99'
+ MNC_LENGTH: 2
+ NSSAI_SST: 1
+ NSSAI_SD0: 1
+ NSSAI_SD1: 112233
+ AMF_IP_ADDRESS: 192.168.71.132
+ GNB_NGA_IF_NAME: eth0
+ GNB_NGA_IP_ADDRESS: 192.168.71.140
+ GNB_NGU_IF_NAME: eth0
+ GNB_NGU_IP_ADDRESS: 192.168.71.140
+ USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
+ depends_on:
+ - oai-ext-dn
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.140
+ healthcheck:
+ test: /bin/bash -c "pgrep nr-softmodem"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ oai-nr-ue:
+ image: oai-nr-ue:develop
+ privileged: true
+ container_name: rfsim5g-oai-nr-ue
+ environment:
+ RFSIMULATOR: 192.168.71.140
+ FULL_IMSI: '208990100001100'
+ FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
+ OPC: 'C42449363BBAD02B66D16BC975D77CC1'
+ DNN: oai
+ NSSAI_SST: 1
+ NSSAI_SD: 1
+ USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 --band 66 -C 2169080000 --CO -400000000 -s 396 --nokrnmod --log_config.global_log_options level,nocolor,time
+ depends_on:
+ - oai-gnb
+ networks:
+ public_net:
+ ipv4_address: 192.168.71.150
+ healthcheck:
+ test: /bin/bash -c "pgrep nr-uesoftmodem"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+networks:
+ public_net:
+ driver: bridge
+ name: rfsim5g-oai-public-net
+ ipam:
+ config:
+ - subnet: 192.168.71.128/26
+ driver_opts:
+ com.docker.network.bridge.name: "rfsim5g-public"
+ traffic_net:
+ driver: bridge
+ name: rfsim5g-oai-traffic-net
+ ipam:
+ config:
+ - subnet: 192.168.72.128/26
+ driver_opts:
+ com.docker.network.bridge.name: "rfsim5g-traffic"
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh
new file mode 100755
index 0000000000..c92efb9f00
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/mysql-healthcheck.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+set -eo pipefail
+
+if [ "$MYSQL_ROOT_PASSWORD" ] && [ -z "$MYSQL_USER" ] && [ -z "$MYSQL_PASSWORD" ]; then
+ echo >&2 'Healthcheck error: cannot determine root password (and MYSQL_USER and MYSQL_PASSWORD were not set)'
+ exit 0
+fi
+
+host="$(hostname --ip-address || echo '127.0.0.1')"
+user="${MYSQL_USER:-root}"
+export MYSQL_PWD="${MYSQL_PASSWORD:-$MYSQL_ROOT_PASSWORD}"
+
+args=(
+ # force mysql to not use the local "mysqld.sock" (test "external" connectivity)
+ -h"$host"
+ -u"$user"
+ --silent
+)
+
+STATUS=0
+if command -v mysqladmin &> /dev/null; then
+ if mysqladmin "${args[@]}" ping > /dev/null; then
+ database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
+ if [[ -z $database_check ]]; then
+ echo "Healthcheck error: oai_db not populated"
+ STATUS=1
+ fi
+ STATUS=0
+ else
+ echo "Healthcheck error: Mysql port inactive"
+ STATUS=1
+ fi
+else
+ if select="$(echo 'SELECT 1' | mysql "${args[@]}")" && [ "$select" = '1' ]; then
+ database_check=$(mysql -u$user -D oai_db --silent -e "SELECT * FROM users;")
+ if [[ -z $database_check ]]; then
+ echo "Healthcheck error: oai_db not populated"
+ STATUS=1
+ fi
+ STATUS=0
+ else
+ echo "Healthcheck error: Mysql port inactive"
+ STATUS=1
+ fi
+fi
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh
new file mode 100755
index 0000000000..3479c092e8
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/nrf-healthcheck.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+NRF_IP_SBI_INTERFACE=$(ifconfig $NRF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
+NRF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$NRF_IP_SBI_INTERFACE:$NRF_INTERFACE_PORT_FOR_SBI")
+#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
+NB_UNREPLACED_AT=`cat /openair-nrf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+fi
+
+if [[ -z $NRF_SBI_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $NRF_INTERFACE_PORT_FOR_SBI is not listening."
+fi
+
+exit $STATUS
\ No newline at end of file
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql
new file mode 100755
index 0000000000..fbd7907a71
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/oai_db.sql
@@ -0,0 +1,217 @@
+-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
+--
+-- Host: localhost Database: oai_db
+-- ------------------------------------------------------
+-- Server version 5.5.46-0ubuntu0.14.04.2
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `apn`
+--
+
+DROP TABLE IF EXISTS `apn`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `apn` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `apn-name` varchar(60) NOT NULL,
+ `pdn-type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `apn-name` (`apn-name`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `apn`
+--
+
+LOCK TABLES `apn` WRITE;
+/*!40000 ALTER TABLE `apn` DISABLE KEYS */;
+/*!40000 ALTER TABLE `apn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `mmeidentity`
+--
+
+DROP TABLE IF EXISTS `mmeidentity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `mmeidentity` (
+ `idmmeidentity` int(11) NOT NULL AUTO_INCREMENT,
+ `mmehost` varchar(255) DEFAULT NULL,
+ `mmerealm` varchar(200) DEFAULT NULL,
+ `UE-Reachability` tinyint(1) NOT NULL COMMENT 'Indicates whether the MME supports UE Reachability Notifcation',
+ PRIMARY KEY (`idmmeidentity`)
+) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `mmeidentity`
+--
+
+LOCK TABLES `mmeidentity` WRITE;
+/*!40000 ALTER TABLE `mmeidentity` DISABLE KEYS */;
+INSERT INTO `mmeidentity` VALUES (2,'mme2.openair4G.eur','openair4G.eur',0),(1,'nano.openair4G.eur','openair4G.eur',0),(5,'abeille.openair4G.eur','openair4G.eur',0),(4,'yang.openair4G.eur','openair4G.eur',0),(3,'mme3.openair4G.eur','openair4G.eur',0),(6,'calisson.openair4G.eur','openair4G.eur',0);
+/*!40000 ALTER TABLE `mmeidentity` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pdn`
+--
+
+DROP TABLE IF EXISTS `pdn`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `pdn` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `apn` varchar(60) NOT NULL,
+ `pdn_type` enum('IPv4','IPv6','IPv4v6','IPv4_or_IPv6') NOT NULL DEFAULT 'IPv4',
+ `pdn_ipv4` varchar(15) DEFAULT '0.0.0.0',
+ `pdn_ipv6` varchar(45) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT '0:0:0:0:0:0:0:0',
+ `aggregate_ambr_ul` int(10) unsigned DEFAULT '50000000',
+ `aggregate_ambr_dl` int(10) unsigned DEFAULT '100000000',
+ `pgw_id` int(11) NOT NULL,
+ `users_imsi` varchar(15) NOT NULL,
+ `qci` tinyint(3) unsigned NOT NULL DEFAULT '9',
+ `priority_level` tinyint(3) unsigned NOT NULL DEFAULT '15',
+ `pre_emp_cap` enum('ENABLED','DISABLED') DEFAULT 'DISABLED',
+ `pre_emp_vul` enum('ENABLED','DISABLED') DEFAULT 'DISABLED',
+ `LIPA-Permissions` enum('LIPA-prohibited','LIPA-only','LIPA-conditional') NOT NULL DEFAULT 'LIPA-only',
+ PRIMARY KEY (`id`,`pgw_id`,`users_imsi`),
+ KEY `fk_pdn_pgw1_idx` (`pgw_id`),
+ KEY `fk_pdn_users1_idx` (`users_imsi`)
+) ENGINE=MyISAM AUTO_INCREMENT=60 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `pdn`
+--
+
+LOCK TABLES `pdn` WRITE;
+/*!40000 ALTER TABLE `pdn` DISABLE KEYS */;
+INSERT INTO `pdn` VALUES (1,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(41,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20834123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(40,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'20810000001234',9,15,'DISABLED','ENABLED','LIPA-only'),(42,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'31002890832150',9,15,'DISABLED','ENABLED','LIPA-only'),(16,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(43,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'001010123456789',9,15,'DISABLED','ENABLED','LIPA-only'),(2,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(3,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(4,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(5,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(6,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(7,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(8,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(9,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(10,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(11,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(12,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(13,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(14,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208940000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(15,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000001',9,15,'DISABLED','ENABLED','LIPA-only'),(17,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000003',9,15,'DISABLED','ENABLED','LIPA-only'),(18,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000004',9,15,'DISABLED','ENABLED','LIPA-only'),(19,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000005',9,15,'DISABLED','ENABLED','LIPA-only'),(20,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000006',9,15,'DISABLED','ENABLED','LIPA-only'),(21,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000007',9,15,'DISABLED','ENABLED','LIPA-only'),(22,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001100',9,15,'DISABLED','ENABLED','LIPA-only'),(23,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001101',9,15,'DISABLED','ENABLED','LIPA-only'),(24,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001102',9,15,'DISABLED','ENABLED','LIPA-only'),(25,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001103',9,15,'DISABLED','ENABLED','LIPA-only'),(26,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001104',9,15,'DISABLED','ENABLED','LIPA-only'),(27,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001105',9,15,'DISABLED','ENABLED','LIPA-only'),(28,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001106',9,15,'DISABLED','ENABLED','LIPA-only'),(29,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001107',9,15,'DISABLED','ENABLED','LIPA-only'),(30,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001108',9,15,'DISABLED','ENABLED','LIPA-only'),(31,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001109',9,15,'DISABLED','ENABLED','LIPA-only'),(32,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001110',9,15,'DISABLED','ENABLED','LIPA-only'),(33,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(34,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(35,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(44,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001113',9,15,'DISABLED','ENABLED','LIPA-only'),(45,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001112',9,15,'DISABLED','ENABLED','LIPA-only'),(46,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208930100001111',9,15,'DISABLED','ENABLED','LIPA-only'),(47,'operator','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000002',9,15,'DISABLED','ENABLED','LIPA-only'),(48,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000008',9,15,'DISABLED','ENABLED','LIPA-only'),(49,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000009',9,15,'DISABLED','ENABLED','LIPA-only'),(50,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000010',9,15,'DISABLED','ENABLED','LIPA-only'),(51,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000011',9,15,'DISABLED','ENABLED','LIPA-only'),(52,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000012',9,15,'DISABLED','ENABLED','LIPA-only'),(53,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000013',9,15,'DISABLED','ENABLED','LIPA-only'),(54,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000014',9,15,'DISABLED','ENABLED','LIPA-only'),(55,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208950000000015',9,15,'DISABLED','ENABLED','LIPA-only'),(56,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001118',9,15,'DISABLED','ENABLED','LIPA-only'),(57,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001121',9,15,'DISABLED','ENABLED','LIPA-only'),(58,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001120',9,15,'DISABLED','ENABLED','LIPA-only'),(59,'oai.ipv4','IPv4','0.0.0.0','0:0:0:0:0:0:0:0',50000000,100000000,3,'208920100001119',9,15,'DISABLED','ENABLED','LIPA-only');
+/*!40000 ALTER TABLE `pdn` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `pgw`
+--
+
+DROP TABLE IF EXISTS `pgw`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `pgw` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `ipv4` varchar(15) NOT NULL,
+ `ipv6` varchar(39) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `ipv4` (`ipv4`),
+ UNIQUE KEY `ipv6` (`ipv6`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `pgw`
+--
+
+LOCK TABLES `pgw` WRITE;
+/*!40000 ALTER TABLE `pgw` DISABLE KEYS */;
+INSERT INTO `pgw` VALUES (1,'127.0.0.1','0:0:0:0:0:0:0:1'),(2,'192.168.56.101',''),(3,'10.0.0.2','0');
+/*!40000 ALTER TABLE `pgw` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `terminal-info`
+--
+
+DROP TABLE IF EXISTS `terminal-info`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `terminal-info` (
+ `imei` varchar(15) NOT NULL,
+ `sv` varchar(2) NOT NULL,
+ UNIQUE KEY `imei` (`imei`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `terminal-info`
+--
+
+LOCK TABLES `terminal-info` WRITE;
+/*!40000 ALTER TABLE `terminal-info` DISABLE KEYS */;
+/*!40000 ALTER TABLE `terminal-info` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `users`
+--
+
+DROP TABLE IF EXISTS `users`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `users` (
+ `imsi` varchar(15) NOT NULL COMMENT 'IMSI is the main reference key.',
+ `msisdn` varchar(46) DEFAULT NULL COMMENT 'The basic MSISDN of the UE (Presence of MSISDN is optional).',
+ `imei` varchar(15) DEFAULT NULL COMMENT 'International Mobile Equipment Identity',
+ `imei_sv` varchar(2) DEFAULT NULL COMMENT 'International Mobile Equipment Identity Software Version Number',
+ `ms_ps_status` enum('PURGED','NOT_PURGED') DEFAULT 'PURGED' COMMENT 'Indicates that ESM and EMM status are purged from MME',
+ `rau_tau_timer` int(10) unsigned DEFAULT '120',
+ `ue_ambr_ul` bigint(20) unsigned DEFAULT '50000000' COMMENT 'The Maximum Aggregated uplink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.',
+ `ue_ambr_dl` bigint(20) unsigned DEFAULT '100000000' COMMENT 'The Maximum Aggregated downlink MBRs to be shared across all Non-GBR bearers according to the subscription of the user.',
+ `access_restriction` int(10) unsigned DEFAULT '60' COMMENT 'Indicates the access restriction subscription information. 3GPP TS.29272 #7.3.31',
+ `mme_cap` int(10) unsigned zerofill DEFAULT NULL COMMENT 'Indicates the capabilities of the MME with respect to core functionality e.g. regional access restrictions.',
+ `mmeidentity_idmmeidentity` int(11) NOT NULL DEFAULT '0',
+ `key` varbinary(16) NOT NULL DEFAULT '0' COMMENT 'UE security key',
+ `RFSP-Index` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'An index to specific RRM configuration in the E-UTRAN. Possible values from 1 to 256',
+ `urrp_mme` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'UE Reachability Request Parameter indicating that UE activity notification from MME has been requested by the HSS.',
+ `sqn` bigint(20) unsigned zerofill NOT NULL,
+ `rand` varbinary(16) NOT NULL,
+ `OPc` varbinary(16) DEFAULT NULL COMMENT 'Can be computed by HSS',
+ PRIMARY KEY (`imsi`,`mmeidentity_idmmeidentity`),
+ KEY `fk_users_mmeidentity_idx1` (`mmeidentity_idmmeidentity`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `users`
+--
+
+LOCK TABLES `users` WRITE;
+/*!40000 ALTER TABLE `users` DISABLE KEYS */;
+INSERT INTO `users` VALUES ('20834123456789','380561234567','35609204079300',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,'+�E��ų\0�,IH��H',0,0,00000000000000000096,'Px�X \Z1��x��','^��K�����FeU���'),('20810000001234','33611123456','35609204079299',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000281454575616225,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','�4�s@���z��~�'),('31002890832150','33638060059','35611302209414',NULL,'PURGED',120,40000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012416,'`�F�݆��D��ϛ���','�4�s@���z��~�'),('001010123456789','33600101789','35609204079298',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'\0 \n\r',1,0,00000000000000000351,'\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0','L�*\\�����^��]� '),('208930000000001','33638030001','35609204079301',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000002','33638050002','35609204079502',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000020471,'\0 \n\r','�4�s@���z��~�'),('208950000000003','33638050003','35609204079503',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012343,'\0 \n\r','�4�s@���z��~�'),('208950000000004','33638050004','35609204079504',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000005','33638050005','35609204079505',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000001','33638050001','35609204079501',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208950000000006','33638050006','35609204079506',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000007','33638050007','35609204079507',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208930000000002','33638030002','35609204079302',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000003','33638030003','35609204079303',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000004','33638030004','35609204079304',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000005','33638030005','35609204079305',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000006','33638030006','35609204079306',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208930000000007','33638030007','35609204079307',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000007','33638040007','35609204079407',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000006','33638040006','35609204079406',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000005','33638040005','35609204079405',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000004','33638040004','35609204079404',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000003','33638040003','35609204079403',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000002','33638040002','35609204079402',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208940000000001','33638040001','35609204079401',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'��wq��gzW�Ё��Z]','�4�s@���z��~�'),('208920100001100','33638020001','35609204079201',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001101','33638020001','35609204079201',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204937234,'\0 \n\r','�$I6;��+f�k�u�|�'),('208920100001102','33638020002','35609204079202',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001103','33638020003','35609204079203',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001104','33638020004','35609204079204',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001105','33638020005','35609204079205',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001106','33638020006','35609204079206',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000000000000006103,'ebd07771ace8677a','�$I6;��+f�k�u�|�'),('208920100001107','33638020007','35609204079207',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001108','33638020008','35609204079208',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001109','33638020009','35609204079209',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208920100001110','33638020010','35609204079210',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001111','33638030011','35609304079211',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001112','33638030012','35609304079212',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006103,'ebd07771ace8677a','�4�s@���z��~�'),('208930100001113','33638030013','35609304079213',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000006263,'�SNܒ�Iv��e�6','�4�s@���z��~�'),('208950000000008','33638050008','35609204079508',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000009','33638050009','35609204079509',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000010','33638050010','35609204079510',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000011','33638050011','35609204079511',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000012','33638050012','35609204079512',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000013','33638050013','35609204079513',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000014','33638050014','35609204079514',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000012215,'56f0261d9d051063','�4�s@���z��~�'),('208950000000015','33638050015','35609204079515',NULL,'PURGED',120,50000000,100000000,47,0000000000,1,'��G?/�Д���� |hb',1,0,00000000000000000000,'3536663032363164','�4�s@���z��~�'),('208920100001118','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204934762,'~?03�u-%�ey�y�','�$I6;��+f�k�u�|�'),('208920100001121','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'&��@xg�]���\n��Vp','�$I6;��+f�k�u�|�'),('208920100001119','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'269482407867805d','�$I6;��+f�k�u�|�'),('208920100001120','33638020010','35609204079210',NULL,'NOT_PURGED',120,50000000,100000000,47,0000000000,1,'��k��p~Љu{�K�',1,0,00000281044204935293,'3236393438323430','�$I6;��+f�k�u�|�');
+INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1);
+INSERT INTO `users` VALUES ('208950000000031','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000032','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000033','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000034','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000035','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000036','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000037','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000038','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000039','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+INSERT INTO `users` VALUES ('208950000000040','380561234567','55000000000001',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0x0C0A34601D4F07677303652C0462535B,0,0,0x40,'ebd07771ace8677a',0x63bfa50ee6523365ff14c1f45f88737d);
+/*!40000 ALTER TABLE `users` ENABLE KEYS */;
+UNLOCK TABLES;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2016-06-28 11:41:40
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh
new file mode 100755
index 0000000000..d9ff7608e8
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/smf-healthcheck.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
+SMF_SBI_PORT_STATUS=$(netstat -tnpl | grep -o "$SMF_IP_SBI_INTERFACE:$SMF_INTERFACE_PORT_FOR_SBI")
+
+#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
+#NB_UNREPLACED_AT=`cat /openair-smf/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+
+#if [ $NB_UNREPLACED_AT -ne 0 ]; then
+# STATUS=-1
+# echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+#fi
+#
+if [[ -z $SMF_SBI_PORT_STATUS ]]; then
+ STATUS=-1
+ echo "Healthcheck error: UNHEALTHY SBI TCP/HTTP port $SMF_INTERFACE_PORT_FOR_SBI is not listening."
+fi
+
+exit $STATUS
diff --git a/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh
new file mode 100755
index 0000000000..0e3b67ee7e
--- /dev/null
+++ b/ci-scripts/yaml_files/5g_fdd_rfsimulator/spgwu-healthcheck.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -eo pipefail
+
+STATUS=0
+SGW_PORT_FOR_S1U_S12_S4_UP=2152
+SGW_PORT_FOR_SX=8805
+SGW_IP_S1U_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP | grep inet | awk {'print $2'})
+SGW_IP_SX_INTERFACE=$(ifconfig $SGW_INTERFACE_NAME_FOR_SX | grep inet | awk {'print $2'})
+S1U_S12_S4_UP_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_S1U_INTERFACE:$SGW_PORT_FOR_S1U_S12_S4_UP")
+SX_PORT_STATUS=$(netstat -unpl | grep -o "$SGW_IP_SX_INTERFACE:$SGW_PORT_FOR_SX")
+#Check if entrypoint properly configured the conf file and no parameter is unset (optional)
+NB_UNREPLACED_AT=`cat /openair-spgwu/etc/*.conf | grep -v contact@openairinterface.org | grep -c @ || true`
+if [ $NB_UNREPLACED_AT -ne 0 ]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY configuration file is not configured properly"
+fi
+
+if [[ -z $S1U_S12_S4_UP_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY S1U port $SGW_PORT_FOR_S1U_S12_S4_UP is not listening."
+fi
+
+if [[ -z $SX_PORT_STATUS ]]; then
+ STATUS=1
+ echo "Healthcheck error: UNHEALTHY SX port $SGW_PORT_FOR_SX is not listening."
+fi
+
+exit $STATUS
\ No newline at end of file
diff --git a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
index f0476b0a1e..808be7d83d 100644
--- a/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
+++ b/ci-scripts/yaml_files/5g_rfsimulator/docker-compose.yaml
@@ -241,15 +241,15 @@ services:
NSSAI_SD1: 112233
AMF_IP_ADDRESS: 192.168.71.132
GNB_NGA_IF_NAME: eth0
- GNB_NGA_IP_ADDRESS: 192.168.71.136
+ GNB_NGA_IP_ADDRESS: 192.168.71.140
GNB_NGU_IF_NAME: eth0
- GNB_NGU_IP_ADDRESS: 192.168.71.136
+ GNB_NGU_IP_ADDRESS: 192.168.71.140
USE_ADDITIONAL_OPTIONS: --sa -E --rfsim --log_config.global_log_options level,nocolor,time
depends_on:
- oai-ext-dn
networks:
public_net:
- ipv4_address: 192.168.71.136
+ ipv4_address: 192.168.71.140
healthcheck:
test: /bin/bash -c "pgrep nr-softmodem"
interval: 10s
@@ -260,7 +260,7 @@ services:
privileged: true
container_name: rfsim5g-oai-nr-ue
environment:
- RFSIMULATOR: 192.168.71.136
+ RFSIMULATOR: 192.168.71.140
FULL_IMSI: '208990100001100'
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
@@ -272,7 +272,7 @@ services:
- oai-gnb
networks:
public_net:
- ipv4_address: 192.168.71.137
+ ipv4_address: 192.168.71.150
healthcheck:
test: /bin/bash -c "pgrep nr-uesoftmodem"
interval: 10s
diff --git a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf
index 9dcb44ef2a..923bf1c388 100644
--- a/ci-scripts/yaml_files/fr1_epc_20897/mme.conf
+++ b/ci-scripts/yaml_files/fr1_epc_20897/mme.conf
@@ -114,7 +114,6 @@ MME :
MME_APP_LOG_LEVEL = "TRACE";
S6A_LOG_LEVEL = "TRACE";
UTIL_LOG_LEVEL = "ERROR";
- MSC_LOG_LEVEL = "ERROR";
ITTI_LOG_LEVEL = "ERROR";
ASN1_VERBOSITY = "annoying";
};
diff --git a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf
index 242b780a40..6bdace2c28 100644
--- a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf
+++ b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf
@@ -121,7 +121,6 @@ MME :
S11_LOG_LEVEL = "DEBUG";
S6A_LOG_LEVEL = "DEBUG";
UTIL_LOG_LEVEL = "INFO";
- MSC_LOG_LEVEL = "ERROR";
ITTI_LOG_LEVEL = "ERROR";
MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR";
ASN1_VERBOSITY = "INFO";
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index b7b365741c..7c60d316e1 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -21,8 +21,10 @@
# Author: laurent THOMAS, Lionel GAUTHIER
-cmake_minimum_required (VERSION 3.0)
+cmake_minimum_required (VERSION 2.8)
+project (OpenAirInterface LANGUAGES C CXX)
+include("macros.cmake")
# System packages that are required
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
@@ -48,6 +50,7 @@ include_directories(${CRYPTO_INCLUDE_DIRS})
#uhd 4.0 and iris installs by default in /usr/local
include_directories("/usr/local/include/")
#use native cmake method as this package is not in pkg-config
+add_list2_option(RF_BOARD "None" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "EXMIMO")
if (${RF_BOARD} STREQUAL "OAI_USRP")
find_package(Boost REQUIRED)
include_directories(${LIBBOOST_INCLUDE_DIR})
@@ -184,106 +187,6 @@ else (CUDA_FOUND)
message ("No CUDA tool installed")
endif ()
-
-###########################################
-# macros to define options as there is numerous options in oai
-################################################
-macro(add_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- add_definitions("-D${name}=${value}")
-endmacro(add_option)
-
-macro(add_boolean_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- set_property(CACHE ${name} PROPERTY TYPE BOOL)
- if (${value})
- add_definitions("-D${name}")
- endif (${value})
-endmacro(add_boolean_option)
-
-macro(add_integer_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- add_definitions("-D${name}=${value}")
-endmacro(add_integer_option)
-
-macro(add_list1_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
- if(NOT "${value}" STREQUAL "False")
- add_definitions("-D${name}=${value}")
- endif()
-endmacro(add_list1_option)
-
-macro(add_list2_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
- if(NOT "${value}" STREQUAL "False")
- add_definitions("-D${value}=1")
- endif()
-endmacro(add_list2_option)
-
-macro(add_list_string_option name val helpstr)
- if(DEFINED ${name})
- set(value ${${name}})
- else(DEFINED ${name})
- set(value ${val})
- endif()
- set(${name} ${value} CACHE STRING "${helpstr}")
- set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
- if(NOT "${value}" STREQUAL "False")
- add_definitions("-D${name}=\"${value}\"")
- endif()
-endmacro(add_list_string_option)
-
-# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
-function(make_version VERSION_VALUE)
- math(EXPR RESULT "0")
- foreach (ARG ${ARGN})
- math(EXPR RESULT "${RESULT} * 16 + ${ARG}")
- endforeach()
- set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE)
-endfunction()
-
-macro(compile_asn1 asn1Source asn1cCmd ResultFlag)
- # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
- execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret)
-
- if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
- endif (NOT ${ret} STREQUAL 0)
-
- add_custom_target (
- ${ResultFlag} ALL
- ${asn1cCmd} ${asn1Source}
- DEPENDS ${asn1Source}
- )
-endmacro(compile_asn1)
-
####################################################
# compilation flags
#############################################
@@ -341,10 +244,10 @@ set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11")
-
+add_boolean_option(SANITIZE_ADDRESS False "enable the address sanitizer (ASan)")
if (SANITIZE_ADDRESS)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
endif ()
add_definitions("-DASN_DISABLE_OER_SUPPORT")
@@ -786,9 +689,6 @@ add_library(F1AP ${F1AP_C_FILES} )
add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
-add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
-
-add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
set (CONFIG_ROOTDIR
${OPENAIR_DIR}/common/config
@@ -938,10 +838,6 @@ add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only vali
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
-add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
-add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
-add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
-
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
@@ -1019,7 +915,6 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
##########################
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
-add_definitions(-DNEW_GTPU=1)
##########################
# RRC LAYER OPTIONS
@@ -1097,8 +992,7 @@ include_directories("${OPENAIR3_DIR}/S1AP")
include_directories("${OPENAIR2_DIR}/X2AP")
include_directories("${OPENAIR2_DIR}/M2AP")
include_directories("${OPENAIR2_DIR}/F1AP")
-include_directories("${OPENAIR3_DIR}/UDP")
-include_directories("${OPENAIR3_DIR}/GTPV1-U")
+include_directories("${OPENAIR3_DIR}/ocp-gtpu")
include_directories("${OPENAIR3_DIR}/M3AP")
include_directories("${OPENAIR3_DIR}/MME_APP")
include_directories("${OPENAIR_DIR}/targets/COMMON")
@@ -1111,7 +1005,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP")
include_directories("${OPENAIR2_DIR}/UTIL/OSA")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
-include_directories("${OPENAIR2_DIR}/LAYER2/PROTO_AGENT")
include_directories("${OPENAIR2_DIR}/UTIL/MEM")
include_directories("${OPENAIR2_DIR}/UTIL/LISTS")
include_directories("${OPENAIR2_DIR}/UTIL/FIFO")
@@ -1124,8 +1017,6 @@ include_directories("${OPENAIR2_DIR}/UTIL/CLI")
include_directories("${OPENAIR2_DIR}/UTIL/OPT")
include_directories("${OPENAIR2_DIR}/UTIL/OMV")
include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES")
-include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared")
-include_directories("${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include")
include_directories("${OPENAIR_DIR}")
# Utilities Library
@@ -1279,18 +1170,6 @@ include_directories (${FSPT_C_DIR})
# set(ASYNC_IF_LIB ASYNC_IF)
# include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
-add_library(PROTO_AGENT
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
- )
-set(PROTO_AGENT_LIB PROTO_AGENT)
-include_directories(${OPENAIR2_DIR}/LAYER2/PROTO_AGENT)
-
-
-
set(PROTOBUF_LIB "protobuf-c")
#set(PROTOBUF_LIB "protobuf") #for Cpp
@@ -1301,11 +1180,6 @@ add_library(HASHTABLE
)
include_directories(${OPENAIR_DIR}/common/utils/hashtable)
-add_library(msc MODULE ${OPENAIR_DIR}/common/utils/msc/msc.c )
-target_link_libraries (msc LFDS)
-
-include_directories(${OPENAIR_DIR}/common/utils/msc)
-
set(UTIL_SRC
# ${OPENAIR2_DIR}/UTIL/CLI/cli.c
# ${OPENAIR2_DIR}/UTIL/CLI/cli_cmd.c
@@ -2161,7 +2035,6 @@ add_library(L2_NR
${MAC_NR_SRC}
${GNB_APP_SRC}
)
-target_compile_definitions(L2_NR PUBLIC NEW_GTPU)
add_library(L2_LTE_NR
${L2_RRC_SRC}
@@ -2169,7 +2042,6 @@ add_library(L2_LTE_NR
${ENB_APP_SRC}
${MCE_APP_SRC}
)
-target_compile_definitions(L2_LTE_NR PUBLIC NEW_GTPU)
add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag x2_flag)
@@ -2210,32 +2082,14 @@ add_library(CN_UTILS
${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
)
-set(GTPV1U_DIR ${OPENAIR3_DIR}/GTPV1-U)
-
-add_library (GTPV1U_OCP
+add_library (GTPV1U
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
${RRC_DIR}/rrc_eNB_GTPV1U.c
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
)
-target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU)
-add_dependencies(GTPV1U_OCP rrc_flag)
+add_dependencies(GTPV1U rrc_flag)
include_directories(${OPENAIR3_DIR}/ocp-gtp)
-#NR case
-set (NR_GTPV1U_SRC
- ${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
- ${RRC_DIR}/rrc_eNB_GTPV1U.c
- ${GTPV1U_DIR}/gtpv1u_eNB.c
- ${GTPV1U_DIR}/gtpv1u_gNB.c
- ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c
- ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c
- ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c
- ${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c
- ${GTPV1U_DIR}/gtpv1u_teid_pool.c
- )
-add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
-add_dependencies(NR_GTPV1U rrc_flag)
-
set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_app.c
${OPENAIR3_DIR}/MME_APP/mme_config.c
@@ -2251,9 +2105,6 @@ set(SCTP_SRC
add_library(SCTP_CLIENT ${SCTP_SRC})
add_dependencies(SCTP_CLIENT rrc_flag)
-add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c)
-add_dependencies(UDP rrc_flag)
-
set(NAS_SRC ${OPENAIR3_DIR}/NAS/)
set(libnas_api_OBJS
${NAS_SRC}COMMON/API/NETWORK/as_message.c
@@ -2808,9 +2659,9 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
@@ -2852,40 +2703,12 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
target_link_libraries (ocp-enb
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U_OCP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
-add_executable(cu_test
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
- ${T_SOURCE}
-)
-target_link_libraries(cu_test
- ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
- ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI
-)
-
-add_executable(du_test
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/du_test.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_handler.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_common.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
- ${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/proto_agent_async.c
- ${T_SOURCE}
-)
-target_link_libraries(du_test
- ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FSPT_MSG_LIB} ${PROTOBUF_LIB}
- ${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ITTI
-)
-
add_executable(oairu
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/ru_control.c
@@ -2946,13 +2769,13 @@ endif()
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
- SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
+ SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${T_LIB})
@@ -2988,13 +2811,12 @@ add_executable(nr-softmodem
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
)
-target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU)
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_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
+ ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR 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 M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
+ X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
@@ -3031,8 +2853,8 @@ add_executable(ocp-gnb
target_link_libraries (ocp-gnb
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
+ ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR 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 M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
-Wl,--end-group z dl)
@@ -3075,16 +2897,16 @@ add_executable(nr-uesoftmodem
target_link_libraries (nr-uesoftmodem
-Wl,--start-group
- RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
+ RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
+ ${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
+target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB})
@@ -3329,7 +3151,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ITTI ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY LFDS ITTI L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
add_executable(test_epc_play_scenario
@@ -3348,7 +3170,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U_OCP LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ITTI -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
@@ -3389,13 +3211,13 @@ if (${T_TRACER})
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
- coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO
+ coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
- CN_UTILS GTPV1U_OCP GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
- ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
+ CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
+ ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
endif()
@@ -3499,14 +3321,13 @@ add_executable(nr-ittisim
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
-target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU)
target_link_libraries (nr-ittisim
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
- ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
+ ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR 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 M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
+ X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
-Wl,--end-group z dl)
diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt
index bd71125cf0..dc91f3c31c 100755
--- a/cmake_targets/at_commands/CMakeLists.txt
+++ b/cmake_targets/at_commands/CMakeLists.txt
@@ -409,7 +409,6 @@ set(emm_HDR
add_library(emm ${emm_SRC} ${emm_HDR})
target_include_directories(emm PRIVATE
- ${OPENAIR_DIR}/common/utils/msc
${OPENAIR_DIR}/common/utils
${OPENAIR_DIR}/openair2/COMMON
${OPENAIR_NAS_DIR}/UE
@@ -693,7 +692,6 @@ include_directories(
${OPENAIR_TARGETS}/COMMON
${OPENAIR_NAS_DIR}/UE
${OPENAIR_DIR}/common/utils
- ${OPENAIR_DIR}/common/utils/msc
${OPENAIR3_DIR}/COMMON
${OPENAIR3_DIR}/SECU
${OPENAIR_NAS_DIR}/src
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index 3472b14efc..6450b64298 100755
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1069,12 +1069,12 @@
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
$OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15
- -s0 -S1 -n1000 -R106
- -s0 -S1 -n10 -I -R106
- -s0 -S1 -n1000 -R217
- -s0 -S1 -n10 -I -R217
- -s0 -S1 -n1000 -R273
- -s0 -S1 -n10 -I -R273
+ -s-11 -S-8 -n10 -R106
+ -s-11 -S-8 -n10 -o8000 -I -R106
+ -s-11 -S-8 -n10 -R217
+ -s-11 -S-8 -n10 -o8000 -I -R217
+ -s-11 -S-8 -n10 -R273
+ -s-11 -S-8 -n10 -o8000 -I -R273
nr_pbchsim.test1 nr_pbchsim.test2 nr_pbchsim.test3 nr_pbchsim.test4 nr_pbchsim.test5 nr_pbchsim.test6
PBCH test OK
segmentation fault|assertion|exiting|fatal
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 7158790b28..df4ec5d01c 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 70819d0e29..f9bb8338bf 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 7381fefc1a..5c3d9214bc 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 8eecfa2ac5..f214f12783 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 ce2b71bdd2..f9f70281ca 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 11e6e24418..87deb03172 100755
--- 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
@@ -165,19 +165,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 11f6adbb4d..039b1d8aa3 100755
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
@@ -182,19 +182,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 3bf79f94bf..3c70040bfc 100755
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
@@ -182,19 +182,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 67a2bae08c..f9d3da2c35 100755
--- a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
+++ b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
@@ -182,19 +182,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 02f29c4c2e..c4b3e00a75 100755
--- 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
@@ -184,19 +184,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 71a479a512..e2786ef21c 100755
--- 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
@@ -184,19 +184,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
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 09958d62e4..8cd9bd6c67 100755
--- 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
@@ -184,19 +184,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
);
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 92bcfd88e2..930f2a7f77 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -39,35 +39,25 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
XFORMS="True"
SKIP_SHARED_LIB_FLAG="False"
-UE_EXPANSION="False"
PRINT_STATS="False"
-VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER=""
-CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False
REL="Rel15"
HW="None"
TP="Ethernet"
EPC=0
VERBOSE_CI=0
VERBOSE_COMPILE=0
-CFLAGS_PROCESSOR_USER=""
RUN_GROUP=0
TEST_CASE_GROUP=""
+BUILD_DIR=ran_build
BUILD_DOXYGEN=0
BUILD_COVERITY_SCAN=0
-T_TRACER="True"
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD="$CMAKE"
-UE_AUTOTEST_TRACE="False"
-UE_DEBUG_TRACE="False"
-UE_TIMING_TRACE="False"
-USRP_REC_PLAY="False"
BUILD_ECLIPSE=0
NR="False"
-ITTI_SIM="False"
-SANITIZE_ADDRESS="False"
-OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc"
+OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope"
RU=0
trap handle_ctrl_c INT
@@ -82,6 +72,8 @@ Options
Erase all files made by previous compilations, installations
--clean-kernel
Erase previously installed features in kernel: iptables, drivers, ...
+-d | --build-dir
+ Sets build directory (will be /cmake_targets//build)
-I | --install-external-packages
Installs required packages such as LibXML, asn1.1 compiler, freediameter, ...
This option will require root password
@@ -201,6 +193,9 @@ function main() {
clean_kernel
echo_info "Erased iptables config and removed modules from kernel"
shift;;
+ -d | --build-dir)
+ BUILD_DIR=$2
+ shift;;
-I | --install-external-packages)
INSTALL_EXTERNAL=1
echo_info "Will install external packages"
@@ -275,7 +270,7 @@ function main() {
echo_info "Will compile NR UE"
shift;;
--mu)
- UE_EXPANSION="True"
+ CMAKE_CMD="$CMAKE_CMD -DUE_EXPANSION=True -DPRE_SCD_THREAD=True"
echo_info "Will compile with UE_EXPANSION"
shift;;
--UE-conf-nvram)
@@ -299,7 +294,9 @@ function main() {
*)
echo_fatal "Unknown HW type $HW: exit..."
esac
- echo_info "Setting hardware to: $HW"
+ echo_info "Setting hardware to: $HW"
+ #CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=\"${HW}\""
+ CMAKE_CMD="$CMAKE_CMD -DRF_BOARD=${HW}"
shift 2;;
-t | --transport)
TP=$2
@@ -323,7 +320,7 @@ function main() {
shift 2;;
-V | --vcd)
echo_info "Setting gtk-wave output"
- VCD_TIMING=1
+ CMAKE_CMD="$CMAKE_CMD -DENABLE_VCD_FIFO=True"
EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
shift;;
-x | --xforms)
@@ -348,8 +345,8 @@ function main() {
echo_info "Will compile with verbose instructions"
shift;;
--cflags_processor)
- CFLAGS_PROCESSOR_USER=$2
- echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
+ CMAKE_CMD="$CMAKE_CMD -DCFLAGS_PROCESSOR_USER=\"$2\""
+ echo_info "Setting CPU FLAGS from USER to: $2"
shift 2;;
--build-doxygen)
BUILD_DOXYGEN=1
@@ -361,22 +358,26 @@ function main() {
shift;;
--disable-deadline)
DEADLINE_SCHEDULER_FLAG_USER="False"
+ CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=False"
echo_info "Disabling the usage of deadline scheduler"
shift 1;;
--enable-deadline)
DEADLINE_SCHEDULER_FLAG_USER="True"
+ CMAKE_CMD="$CMAKE_CMD -DDEADLINE_SCHEDULER=True"
echo_info "Enabling the usage of deadline scheduler"
shift 1;;
--enable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="True"
+ CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=True"
echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)"
shift 1;;
--disable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="False"
+ CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False"
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
shift 1;;
--disable-T-Tracer)
- T_TRACER="False"
+ CMAKE_CMD="$CMAKE_CMD -DT_TRACER=False"
echo_info "Disabling the T tracer"
shift 1;;
--disable-hardware-dependency)
@@ -384,15 +385,15 @@ function main() {
DISABLE_HARDWARE_DEPENDENCY="True"
shift 1;;
--ue-autotest-trace)
- UE_AUTOTEST_TRACE="True"
+ CMAKE_CMD="$CMAKE_CMD -DUE_AUTOTEST_TRACE=True"
echo_info "Enabling autotest specific trace for UE"
shift 1;;
--ue-trace)
- UE_DEBUG_TRACE="True"
+ CMAKE_CMD="$CMAKE_CMD -DUE_DEBUG_TRACE=False"
echo_info "Enabling UE trace for debug"
shift 1;;
--ue-timing)
- UE_TIMING_TRACE="True"
+ CMAKE_CMD="$CMAKE_CMD -DUE_TIMING_TRACE=True"
echo_info "Enabling UE timing trace"
shift 1;;
--uhd-images-dir)
@@ -423,24 +424,20 @@ function main() {
fi
fi
shift 2;;
- --usrp-recplay)
- USRP_REC_PLAY="True"
- echo_info "Enabling USRP record playback mode"
- shift 1;;
-k | --skip-shared-libraries)
SKIP_SHARED_LIB_FLAG="True"
echo_info "Skipping build of shared libraries, rfsimulator and transport protocol libraries"
shift;;
- --ninja)
- CMAKE_CMD="$CMAKE_CMD -GNinja"
- MAKE_CMD=ninja
- shift;;
- --sanitize-address | -fsanitize=address)
- SANITIZE_ADDRESS=True
- shift;;
- --ittiSIM)
+ --ninja)
+ CMAKE_CMD="$CMAKE_CMD -GNinja"
+ MAKE_CMD=ninja
+ shift;;
+ --sanitize-address | -fsanitize=address)
+ CMAKE_CMD="$CMAKE_CMD -DSANITIZE_ADDRESS=True"
+ shift;;
+ --ittiSIM)
ittiSIM=1
- ITTI_SIM="True"
+ CMAKE_CMD="$CMAKE_CMD -DITTI_SIM=True"
echo_info "Will compile itti simulator"
shift;;
-h | --help)
@@ -466,9 +463,6 @@ function main() {
fi
fi
- CMAKE_CMD="$CMAKE_CMD .."
- echo_info "CMAKE_CMD=$CMAKE_CMD"
-
########################################################
# Check validity of HW and TP parameters for eNB / gNB #
########################################################
@@ -508,6 +502,7 @@ function main() {
#Disable CPU Affinity for deadline scheduler
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
+ CMAKE_CMD="$CMAKE_CMD -DCPU_AFFINITY=False"
fi
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
@@ -585,46 +580,13 @@ function main() {
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets
- if [ "$T_TRACER" = "False" ] ; then
- build_dir=ran_build_noLOG
- else
- build_dir=ran_build
- fi
- [ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
- mkdir -p $DIR/$build_dir/build
+ [ "$CLEAN" = "1" ] && rm -rf $DIR/$BUILD_DIR/build
+ mkdir -p $DIR/$BUILD_DIR/build
-# configuration module libraries, one currently available, using libconfig
- config_libconfig_shlib=params_libconfig
-
- # first generate the CMakefile in the right directory
- # softmodem compilation
-
- cmake_file=$DIR/$build_dir/CMakeLists.txt
- echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
- echo "project (OpenAirInterface)" >> $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 ( 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 "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
- echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file
- echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file
- echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
- cd $DIR/$build_dir/build
- eval $CMAKE_CMD
+ cd $DIR/$BUILD_DIR/build
+ echo_info "running $CMAKE_CMD"
+ eval $CMAKE_CMD ../..
execlist=""
if [ "$eNB" = "1" ] ; then
@@ -653,7 +615,7 @@ function main() {
for f in $execlist ; do
echo_info "Compiling $f..."
compilations \
- $build_dir $f \
+ $BUILD_DIR $f \
$f $dbin/$f.$REL
done
@@ -662,13 +624,16 @@ function main() {
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
echo_info "Building shared libraries common to UE and gNB"
+
+ # configuration module libraries, one currently available, using libconfig
+ config_libconfig_shlib=params_libconfig
compilations \
- $build_dir $config_libconfig_shlib \
+ $BUILD_DIR $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations \
- $build_dir coding \
+ $BUILD_DIR coding \
libcoding.so $dbin/libcoding.so
fi
@@ -681,7 +646,7 @@ function main() {
then
echo_info "Building ue_ip module"
compilations \
- $build_dir ue_ip \
+ $BUILD_DIR ue_ip \
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
else
echo_info "Bypassing ue_ip build"
@@ -698,7 +663,7 @@ function main() {
mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build
- eval $CMAKE_CMD
+ eval $CMAKE_CMD ..
compilations \
nas_sim_tools usim \
usim $dbin/usim
@@ -712,16 +677,16 @@ function main() {
# generate USIM data
if [ -f $dbin/conf2uedata ]; then
install_nas_tools $conf_nvram_path $gen_nvram_path "$dlog/conf2uedata.txt"
- echo_info "Copying UE specific part to $DIR/$build_dir/build"
- cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$build_dir/build
- cp -Rvf $dbin/.ue.nvram0 $DIR/$build_dir/build
- cp -Rvf $dbin/.usim.nvram0 $DIR/$build_dir/build
+ echo_info "Copying UE specific part to $DIR/$BUILD_DIR/build"
+ cp -Rvf $dbin/.ue_emm.nvram0 $DIR/$BUILD_DIR/build
+ cp -Rvf $dbin/.ue.nvram0 $DIR/$BUILD_DIR/build
+ cp -Rvf $dbin/.usim.nvram0 $DIR/$BUILD_DIR/build
else
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
- cd $DIR/$build_dir/build
+ cd $DIR/$BUILD_DIR/build
##################
# PHY simulators #
@@ -739,9 +704,6 @@ function main() {
compilations \
ran_build coding \
libcoding.so $dbin/libcoding.so
-# compilations \
-# lte-simulators $config_libconfig_shlib \
-# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi
###################
@@ -763,14 +725,14 @@ function main() {
if [ "$HW" = "EXMIMO" ] ; then
echo_info "Compiling Express MIMO 2 board drivers"
compilations \
- $build_dir openair_rf \
+ $BUILD_DIR openair_rf \
CMakeFiles/openair_rf/openair_rf.ko $dbin/openair_rf.ko
compilations \
- $build_dir updatefw \
+ $BUILD_DIR updatefw \
updatefw $dbin/updatefw
echo_info "Compiling oarf tools. The logfile for compilation is here: $dlog/oarf.txt"
- make -C $OPENAIR_DIR/cmake_targets/$build_dir/build oarf > $dlog/oarf.txt 2>&1
- cp $OPENAIR_DIR/cmake_targets/$build_dir/build/*.oct $dbin
+ make -C $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build oarf > $dlog/oarf.txt 2>&1
+ cp $OPENAIR_DIR/cmake_targets/$BUILD_DIR/build/*.oct $dbin
if [ -s $dbin/oarf_config_exmimo.oct ] ; then
echo_success "oarf tools compiled"
else
@@ -785,7 +747,7 @@ function main() {
if [ ! -z "$BUILD_OPTLIB" ] ; then
for oklib in $BUILD_OPTLIB ; do
compilations \
- $build_dir $oklib \
+ $BUILD_DIR $oklib \
lib${oklib}.so $dbin/lib${oklib}.so
done
fi
@@ -859,7 +821,7 @@ function main() {
# link liboai_device.so with the selected RF device library
if [ "$HW" == "EXMIMO" ] ; then
compilations \
- $build_dir oai_exmimodevif \
+ $BUILD_DIR oai_exmimodevif \
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
ln -sf liboai_exmimodevif.so liboai_device.so
@@ -867,7 +829,7 @@ function main() {
echo_info "liboai_device.so is linked to EXMIMO device library"
elif [ "$HW" == "OAI_USRP" ] ; then
compilations \
- $build_dir oai_usrpdevif \
+ $BUILD_DIR oai_usrpdevif \
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
ln -sf liboai_usrpdevif.so liboai_device.so
@@ -876,7 +838,7 @@ function main() {
elif [ "$HW" == "OAI_BLADERF" ] ; then
if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
- $build_dir oai_bladerfdevif \
+ $BUILD_DIR oai_bladerfdevif \
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
fi
@@ -886,7 +848,7 @@ function main() {
elif [ "$HW" == "OAI_LMSSDR" ] ; then
# if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \
- $build_dir oai_lmssdrdevif \
+ $BUILD_DIR oai_lmssdrdevif \
liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL
# fi
@@ -895,7 +857,7 @@ function main() {
echo_info "liboai_device.so is linked to LMSSDR device library"
elif [ "$HW" == "OAI_IRIS" ] ; then
compilations \
- $build_dir oai_irisdevif \
+ $BUILD_DIR oai_irisdevif \
liboai_irisdevif.so $dbin/liboai_irisdevif.so.$REL
ln -s liboai_irisdevif.so liboai_device.so
@@ -915,7 +877,7 @@ function main() {
echo_info "liboai_device.so is linked to ADRV9371_ZC706 device library for Kernel $SYRIQ_KMAJ.$SYRIQ_KMIN"
elif [ "$HW" == "OAI_AW2SORI" ] ; then
compilations \
- $build_dir aw2sori_transpro \
+ $BUILD_DIR aw2sori_transpro \
libaw2sori_transpro.so $dbin/libaw2sori_transpro.so.$REL
ln -sf libaw2sori_transpro.so libthirdparty_transpro.so
@@ -930,12 +892,12 @@ function main() {
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
echo_info "Compiling rfsimulator"
compilations \
- $build_dir rfsimulator \
+ $BUILD_DIR rfsimulator \
librfsimulator.so $dbin/librfsimulator.so.$REL
echo_info "Compiling tcp_bridge_oai"
compilations \
- $build_dir tcp_bridge_oai \
+ $BUILD_DIR tcp_bridge_oai \
libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
fi
@@ -946,7 +908,7 @@ function main() {
rm -f $dbin/liboai_transpro.so
if [ "$TP" == "Ethernet" ]; then
compilations \
- $build_dir oai_eth_transpro \
+ $BUILD_DIR oai_eth_transpro \
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
ln -sf liboai_eth_transpro.so liboai_transpro.so
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
@@ -954,7 +916,7 @@ function main() {
fi
if [ "$TP" == "benetel4g" ]; then
compilations \
- $build_dir benetel_4g \
+ $BUILD_DIR benetel_4g \
libbenetel_4g.so $dbin/libbenetel_4g.$REL
ln -sf libbenetel_4g.so liboai_transpro.so
ln -sf $dbin/libbenetel_4g.so.$REL $dbin/liboai_transpro.so
@@ -962,7 +924,7 @@ function main() {
fi
if [ "$TP" == "benetel5g" ]; then
compilations \
- $build_dir benetel_5g \
+ $BUILD_DIR benetel_5g \
libbenetel_5g.so $dbin/libbenetel_5g.$REL
ln -sf libbenetel_5g.so liboai_transpro.so
ln -sf $dbin/libbenetel_5g.so.$REL $dbin/liboai_transpro.so
@@ -983,7 +945,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
cd $OPENAIR_DIR/cmake_targets/doxygen/build
- eval $CMAKE_CMD
+ eval $CMAKE_CMD ..
make doc
) >& $doxygen_log
fi
diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template
index 7a097fffb0..28da13437c 100755
--- a/cmake_targets/epc_test/CMakeLists.template
+++ b/cmake_targets/epc_test/CMakeLists.template
@@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR False)
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
diff --git a/cmake_targets/install_external_packages.ubuntu20 b/cmake_targets/install_external_packages.ubuntu20
index e58f5c9bb1..a2f6a9709c 100755
--- a/cmake_targets/install_external_packages.ubuntu20
+++ b/cmake_targets/install_external_packages.ubuntu20
@@ -86,6 +86,7 @@ check_supported_distribution() {
"ubuntu20.04") return 0 ;;
"ubuntu20.10") return 0 ;;
"ubuntu21.04") return 0 ;;
+ "ubuntu21.10") return 0 ;;
esac
return 1
}
@@ -409,7 +410,6 @@ check_install_ubuntu_packages() {
libxml2 \
libxml2-dev \
libxslt1-dev \
- mscgen \
octave-signal \
openssh-client \
openssh-server \
diff --git a/cmake_targets/macros.cmake b/cmake_targets/macros.cmake
new file mode 100644
index 0000000000..0417420af4
--- /dev/null
+++ b/cmake_targets/macros.cmake
@@ -0,0 +1,98 @@
+###########################################
+# macros to define options as there is numerous options in oai
+################################################
+macro(add_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ add_definitions("-D${name}=${value}")
+endmacro(add_option)
+
+macro(add_boolean_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ set_property(CACHE ${name} PROPERTY TYPE BOOL)
+ if (${value})
+ add_definitions("-D${name}")
+ endif (${value})
+endmacro(add_boolean_option)
+
+macro(add_integer_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ add_definitions("-D${name}=${value}")
+endmacro(add_integer_option)
+
+macro(add_list1_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
+ if(NOT "${value}" STREQUAL "False")
+ add_definitions("-D${name}=${value}")
+ endif()
+endmacro(add_list1_option)
+
+macro(add_list2_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
+ if(NOT "${value}" STREQUAL "False")
+ add_definitions("-D${value}=1")
+ endif()
+endmacro(add_list2_option)
+
+macro(add_list_string_option name val helpstr)
+ if(DEFINED ${name})
+ set(value ${${name}})
+ else(DEFINED ${name})
+ set(value ${val})
+ endif()
+ set(${name} ${value} CACHE STRING "${helpstr}")
+ set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
+ if(NOT "${value}" STREQUAL "False")
+ add_definitions("-D${name}=\"${value}\"")
+ endif()
+endmacro(add_list_string_option)
+
+# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
+function(make_version VERSION_VALUE)
+ math(EXPR RESULT "0")
+ foreach (ARG ${ARGN})
+ math(EXPR RESULT "${RESULT} * 16 + ${ARG}")
+ endforeach()
+ set(${VERSION_VALUE} "${RESULT}" PARENT_SCOPE)
+endfunction()
+
+macro(compile_asn1 asn1Source asn1cCmd ResultFlag)
+ # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
+ execute_process(COMMAND ${asn1cCmd} ${asn1Source} RESULT_VARIABLE ret)
+
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+
+ add_custom_target (
+ ${ResultFlag} ALL
+ ${asn1cCmd} ${asn1Source}
+ DEPENDS ${asn1Source}
+ )
+endmacro(compile_asn1)
diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template
index e62df04bc6..d2d2d3e053 100755
--- a/cmake_targets/s1c_mme_test/CMakeLists.template
+++ b/cmake_targets/s1c_mme_test/CMakeLists.template
@@ -26,7 +26,6 @@ set ( LOG_NO_THREAD True )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR False)
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index ec5de6a0d1..55a39c6b2b 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -765,7 +765,6 @@ check_install_oai_software() {
libxml2 \
libxml2-dev \
libxslt1-dev \
- mscgen \
octave-signal \
openssh-client \
openssh-server \
@@ -793,7 +792,7 @@ check_install_oai_software() {
fi
$SUDO $INSTALLER install -y python-epdb vim-common
else
- $SUDO $INSTALLER install -y mscgen pydb
+ $SUDO $INSTALLER install -y pydb
fi
$SUDO $INSTALLER install -y \
diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
index 238554f8e2..b55266dfe7 100755
--- a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
+++ b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
@@ -85,18 +85,7 @@ Tools available:
1) itti_analyser (list messages exchanged between protocol layers)
2) xforms (Layer 1)
-3) mscgen (under construction, but can give some results now)
- (http://www.mcternan.me.uk/mscgen/)
- We use the software to generate sequence diagrams
- with traces generated during the execution of the eNB.
- After the enb execution:
- yang@yang:...$ cd /tmp
- yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py
- The results are located in the current directory (/tmp in this example) in a folder. The name of the folder
- is the current date (for example: 2015-04-08_20.34.10).
- The results are input files for the mscgen tool containing events or messages and the
- corresponding generated png files.
-4) vcd (timing mesurements)
+3) vcd (timing mesurements)
diff --git a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt
index 9996a53e19..805d121e6d 100755
--- a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt
+++ b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt
@@ -92,18 +92,7 @@ Tools available:
1) itti_analyser (list messages exchanged between protocol layers)
2) xforms (Layer 1)
-3) mscgen (under construction, but can give some results now)
- (http://www.mcternan.me.uk/mscgen/)
- We use the software to generate sequence diagrams
- with traces generated during the execution of the eNB.
- After the enb execution:
- yang@yang:...$ cd /tmp
- yang@yang:/tmp$ /home/yang/openair4G/trunk/targets/SCRIPTS/msc_gen.py
- The results are located in the current directory (/tmp in this example) in a folder. The name of the folder
- is the current date (for example: 2015-04-08_20.34.10).
- The results are input files for the mscgen tool containing events or messages and the
- corresponding generated png files.
-4) vcd (timing mesurements)
+3) vcd (timing mesurements)
diff --git a/cmake_targets/tools/run_enb_s1_usrp b/cmake_targets/tools/run_enb_s1_usrp
index 1a4c6b10b8..db22e31493 100755
--- a/cmake_targets/tools/run_enb_s1_usrp
+++ b/cmake_targets/tools/run_enb_s1_usrp
@@ -32,8 +32,6 @@
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
-declare -i g_run_msc_gen=0
-declare g_msc_dir="/tmp"
function help()
@@ -55,7 +53,6 @@ function help()
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -n, --T-no-wait don't wait for tracer, start immediately"
echo_error " -p, --T-port port use given port"
- echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
@@ -68,30 +65,10 @@ function help()
}
-function do_msc_gen()
-{
- cd $g_msc_dir
- last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
- $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py
- sync
- last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
-
- if [ x"$last_created_file" != x"$last_created_file2" ]; then
- if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
- command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
- fi
- fi
-
-}
-
-
function control_c()
# run if user hits control-c
{
echo_warning "\nExiting by ctrl+c\n"
- if [ $g_run_msc_gen -eq 1 ]; then
- do_msc_gen
- fi
exit $?
}
@@ -153,18 +130,6 @@ function main()
exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
fi
;;
- -m | --mscgen)
- g_msc_dir=$2
- # can omit file name if last arg on the line
- if [ -d "$g_msc_dir" ]; then
- echo "setting mscgen log files to dir: $g_msc_dir"
- g_run_msc_gen=1
- shift 2;
- else
- echo_error "Mscgen log dir does not exist"
- exit -1
- fi
- ;;
-M | --target-dl-mcs)
echo "setting target dl MCS to $2"
exe_arguments="$exe_arguments -m $2"
@@ -251,9 +216,6 @@ function main()
else
gdb -n -x ~/.gdb_lte_softmodem
fi
- if [ $g_run_msc_gen -eq 1 ]; then
- do_msc_gen
- fi
fi
}
diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1
index 79d5bc35dc..5f8e7e5374 100755
--- a/cmake_targets/tools/run_enb_ue_virt_noS1
+++ b/cmake_targets/tools/run_enb_ue_virt_noS1
@@ -57,7 +57,6 @@ function help()
echo_error " -l, --log-level set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
- echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
@@ -75,11 +74,9 @@ function main()
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
local -i run_gdb=0
- local -i run_mscgen=0
local exe_arguments=""
local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB
- local MSC_DIR="/tmp"
local abstraction_flag=0
until [ -z "$1" ]
@@ -136,17 +133,6 @@ function main()
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
- -m | --mscgen)
- MSC_DIR=$2
- if [ -d "$MSC_DIR" ]; then
- echo "setting mscgen log files to dir: $MSC_DIR"
- run_mscgen=1
- shift 2;
- else
- echo_error "Mscgen log dir does not exist"
- exit -1
- fi
- ;;
# -u | --num-ue )
-V | --vcd)
@@ -212,10 +198,6 @@ function main()
cd $OPENAIR_DIR/targets/bin
- if [ $run_mscgen -eq 1 ]; then
- $SUDO rm -f /tmp/openair.msc.*
- fi
-
if [ $run_gdb -eq 0 ]; then
exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
else
@@ -227,20 +209,6 @@ function main()
cat ~/.gdb_enb_ue_nos1
$SUDO gdb -n -x ~/.gdb_enb_ue_nos1
fi
-
- if [ $run_mscgen -eq 1 ]; then
- cd $MSC_DIR
- last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
- $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
- sync
- last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
-
- if [ x"$last_created_file" != x"$last_created_file2" ]; then
- if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
- command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
- fi
- fi
- fi
}
main "$@"
diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1
index 50fc819ec8..76bc3c2b39 100755
--- a/cmake_targets/tools/run_enb_ue_virt_s1
+++ b/cmake_targets/tools/run_enb_ue_virt_s1
@@ -81,7 +81,6 @@ function help()
echo_error " -g, --gdb Run with GDB."
echo_error " -h, --help Print this help."
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
- echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -V, --vcd Dump timings of processing in a GTKWave compliant file format."
echo_error " -W, --wireshark-l2 Dump MAC frames for visualization with wireshark."
echo_error " You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
@@ -100,11 +99,9 @@ function main()
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
local -i run_gdb=0
- local -i run_mscgen=0
local exe_arguments=""
local DEFAULT_CONFIG_FILE_ENB=$OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_mme.conf
local CONFIG_FILE_ENB=$DEFAULT_CONFIG_FILE_ENB
- local MSC_DIR="/tmp"
until [ -z "$1" ]
do
@@ -160,19 +157,6 @@ function main()
exe_arguments="$exe_arguments -K $ITTI_DUMP_FILE"
;;
- -m | --mscgen)
- MSC_DIR=$2
- # can omit file name if last arg on the line
- if [ -d "$MSC_DIR" ]; then
- echo "setting mscgen log files to dir: $MSC_DIR"
- run_mscgen=1
- shift 2;
- else
- echo_error "Mscgen log dir does not exist"
- exit -1
- fi
- ;;
-
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
@@ -258,10 +242,6 @@ function main()
cd $OPENAIR_DIR/targets/bin
- if [ $run_mscgen -eq 1 ]; then
- rm -f /tmp/openair.msc.*
- fi
-
if [ $run_gdb -eq 0 ]; then
exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
else
@@ -273,21 +253,6 @@ function main()
cat ~/.gdb_enb_ue_s1
gdb -n -x ~/.gdb_enb_ue_s1
fi
-
- if [ $run_mscgen -eq 1 ]; then
- cd $MSC_DIR
- last_created_file=`ls -t mscgen* | head -1 | tr -d ':'`
- $OPENAIR_DIR/targets/SCRIPTS/msc_gen.py --profile E_UTRAN
- sync
- last_created_file2=`ls -t mscgen* | head -1 | tr -d ':'`
-
- if [ x"$last_created_file" != x"$last_created_file2" ]; then
- if [ -f ./$last_created_file2/oai_mscgen_page_0.png ]; then
- command -v eog 2>/dev/null && eog ./$last_created_file2/oai_mscgen_page_0.png
- fi
- fi
- fi
-
}
sudo echo
diff --git a/common/config/DOC/config/rtusage.md b/common/config/DOC/config/rtusage.md
index 10cbee2495..8db58ddac3 100644
--- a/common/config/DOC/config/rtusage.md
+++ b/common/config/DOC/config/rtusage.md
@@ -65,7 +65,6 @@ To get help on supported parameters you can use specific options:
-R: Enable online log
-g: Set the global log level, valide options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))
--telnetsrv: Start embedded telnet server
- --msc: Enable the MSC tracing utility
--------------------------------------------------------------------
[LIBCONFIG] loader: 2/2 parameters successfully set, (2 to default value)
diff --git a/common/ran_context.h b/common/ran_context.h
index db981e9182..055c6f783e 100644
--- a/common/ran_context.h
+++ b/common/ran_context.h
@@ -42,17 +42,11 @@
//#include "ENB_APP/enb_config.h"
#include "flexran_agent_defs.h"
-#include "gtpv1u.h"
-#include "NwGtpv1u.h"
-#include "NwGtpv1uMsg.h"
-#include "NwGtpv1uPrivate.h"
-#include "gtpv1u_eNB_defs.h"
-#include "gtpv1u_gNB_defs.h"
-
#include "PHY/defs_L1_NB_IoT.h"
#include "RRC/LTE/defs_NB_IoT.h"
#include "RRC/LTE/rrc_defs.h"
#include "RRC/NR/nr_rrc_defs.h"
+#include
typedef struct {
@@ -110,8 +104,6 @@ typedef struct {
struct gNB_MAC_INST_s **nrmac;
/// GTPu descriptor
gtpv1u_data_t *gtpv1u_data_g;
- /// NR GTPu descriptor
- nr_gtpv1u_data_t *nr_gtpv1u_data_g;
/// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces
struct RU_t_s **ru;
/// Mask to indicate fronthaul setup status of RU (hard-limit to 64 RUs)
diff --git a/common/utils/LOG/DOC/rtusage.md b/common/utils/LOG/DOC/rtusage.md
index 041c29e688..2f6fa5e6ea 100644
--- a/common/utils/LOG/DOC/rtusage.md
+++ b/common/utils/LOG/DOC/rtusage.md
@@ -49,7 +49,6 @@ The list of components defined within oai can be retrieved from the [config mod
[CONFIG] log_config.perf_log_level set to default value "info"
[CONFIG] log_config.oip_log_level set to default value "info"
[CONFIG] log_config.cli_log_level set to default value "info"
-[CONFIG] log_config.msc_log_level set to default value "info"
[CONFIG] log_config.ocm_log_level set to default value "info"
[CONFIG] log_config.udp_log_level set to default value "info"
[CONFIG] log_config.gtpv1u_log_level set to default value "info"
@@ -108,8 +107,6 @@ The list of components defined within oai can be retrieved from the [config mod
[CONFIG] log_config.oip_log_infile set to default value
[CONFIG] cli_log_infile: 0
[CONFIG] log_config.cli_log_infile set to default value
-[CONFIG] msc_log_infile: 0
-[CONFIG] log_config.msc_log_infile set to default value
[CONFIG] ocm_log_infile: 0
[CONFIG] log_config.ocm_log_infile set to default value
[CONFIG] udp_log_infile: 0
diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index 29e4f718c6..5b047c082d 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -411,6 +411,16 @@ int register_log_component(char *name,
return computed_compidx;
}
+static void unregister_all_log_components(void)
+{
+ log_component_t* lc = &g_log->log_component[0];
+ while (lc->name) {
+ free((char *)lc->name); // defined as const, but assigned through strdup()
+ free(lc->filelog_name);
+ lc++;
+ }
+}
+
int isLogInitDone (void)
{
if (g_log == NULL)
@@ -449,7 +459,6 @@ int logInit (void)
register_log_component("OCG","",OCG);
register_log_component("PERF","",PERF);
register_log_component("OIP","",OIP);
- register_log_component("MSC","log",MSC);
register_log_component("OCM","log",OCM);
register_log_component("HW","",HW);
register_log_component("OSA","",OSA);
@@ -503,6 +512,12 @@ int logInit (void)
return 0;
}
+void logTerm(void)
+{
+ unregister_all_log_components();
+ free_and_zero(g_log);
+}
+
#include
static inline int log_header(log_component_t *c,
char *log_buffer,
diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h
index 46c73427c1..d73fc03ed9 100644
--- a/common/utils/LOG/log.h
+++ b/common/utils/LOG/log.h
@@ -212,7 +212,6 @@ typedef enum {
PERF,
OIP,
CLI,
- MSC,
OCM,
UDP_,
GTPU,
@@ -303,6 +302,7 @@ extern "C" {
# include "log_if.h"
/*----------------------------------------------------------------------------*/
int logInit (void);
+void logTerm (void);
int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
diff --git a/common/utils/assertions.h b/common/utils/assertions.h
index d85dab79a0..573036b1d9 100644
--- a/common/utils/assertions.h
+++ b/common/utils/assertions.h
@@ -25,14 +25,21 @@
#include
#include
#include
+#include
+#include
#include
#include "backtrace.h"
-#define _Assert_Exit_ \
- fprintf(stderr, "\nExiting execution\n"); \
- fflush(stdout); \
- fflush(stderr); \
- abort();
+#define _Assert_Exit_ \
+ if (getenv("gdbStacks")) { \
+ char tmp [1000]; \
+ sprintf(tmp,"gdb -ex='set confirm off' -ex 'thread apply all bt' -ex q -p %d < /dev/null", getpid()); \
+ __attribute__((unused)) int dummy=system(tmp); \
+ } \
+ fprintf(stderr, "\nExiting execution\n"); \
+ fflush(stdout); \
+ fflush(stderr); \
+ abort();
#define _Assert_(cOND, aCTION, fORMAT, aRGS...) \
do { \
diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c
index 2b0d339358..1c9aa8cab9 100644
--- a/common/utils/load_module_shlib.c
+++ b/common/utils/load_module_shlib.c
@@ -69,7 +69,6 @@ char *loader_format_shlibpath(char *modname, char *version)
char *tmpstr;
char *shlibpath =NULL;
char *shlibversion=NULL;
-char *cfgprefix;
paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0, NULL},
{"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0, NULL}};
@@ -81,16 +80,11 @@ int ret;
/* looks for specific path for this module in the config file */
/* specific value for a module path and version is located in a modname subsection of the loader section */
/* shared lib name is formatted as lib.so */
- cfgprefix = malloc(sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16);
- if (cfgprefix == NULL) {
- fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
- exit_fun("[LOADER] unrecoverable error");
- } else {
- sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
- int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix);
- if (ret <0) {
- fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix);
- }
+ char cfgprefix[sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16];
+ sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
+ ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix);
+ if (ret <0) {
+ fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix);
}
/* no specific path, use loader default shared lib path */
if (shlibpath == NULL) {
@@ -142,6 +136,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
}
shlib_path = loader_format_shlibpath(modname, version);
+ printf("shlib_path %s\n", shlib_path);
for (int i = 0; i < loader_data.numshlibs; i++) {
if (strcmp(loader_data.shlibs[i].name, modname) == 0) {
@@ -198,15 +193,17 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
}
if (farray) {
- if (!loader_data.shlibs[lib_idx].funcarray) {
- loader_data.shlibs[lib_idx].funcarray = malloc(numf*sizeof(loader_shlibfunc_t));
- if (!loader_data.shlibs[lib_idx].funcarray) {
+ loader_shlibdesc_t *shlib = &loader_data.shlibs[lib_idx];
+ if (!shlib->funcarray) {
+ shlib->funcarray = calloc(numf, sizeof(loader_shlibfunc_t));
+ if (!shlib->funcarray) {
fprintf(stderr, "[LOADER] load_module_shlib(): unable to allocate memory\n");
ret = -1;
goto load_module_shlib_exit;
}
+ shlib->len_funcarray = numf;
+ shlib->numfunc = 0;
}
- loader_data.shlibs[lib_idx].numfunc = 0;
for (int i = 0; i < numf; i++) {
farray[i].fptr = dlsym(lib_handle,farray[i].fname);
if (!farray[i].fptr) {
@@ -215,9 +212,32 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
ret = -1;
goto load_module_shlib_exit;
}
- loader_data.shlibs[lib_idx].funcarray[i].fname=strdup(farray[i].fname);
- loader_data.shlibs[lib_idx].funcarray[i].fptr = farray[i].fptr;
- loader_data.shlibs[lib_idx].numfunc++;
+ /* check whether this function has been loaded before */
+ int j = 0;
+ for (; j < shlib->numfunc; ++j) {
+ if (shlib->funcarray[j].fptr == farray[i].fptr) {
+ int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname);
+ AssertFatal(rc == 0,
+ "reloading the same fptr with different fnames (%s, %s)\n",
+ shlib->funcarray[i].fname, farray[i].fname);
+ break;
+ }
+ }
+ if (j == shlib->numfunc) {
+ if (shlib->numfunc == shlib->len_funcarray) {
+ loader_shlibfunc_t *n = realloc(shlib->funcarray, shlib->numfunc * 2 * sizeof(loader_shlibfunc_t));
+ if (!n) {
+ fprintf(stderr, "[LOADER] %s(): unable to allocate memory\n", __func__);
+ ret = -1;
+ goto load_module_shlib_exit;
+ }
+ shlib->funcarray = n;
+ shlib->len_funcarray = shlib->numfunc * 2;
+ }
+ shlib->funcarray[j].fname = strdup(farray[i].fname);
+ shlib->funcarray[j].fptr = farray[i].fptr;
+ shlib->numfunc++;
+ }
} /* for int i... */
} else { /* farray ! NULL */
sprintf(afname,"%s_getfarray",modname);
@@ -248,3 +268,18 @@ void * get_shlibmodule_fptr(char *modname, char *fname)
} /* for i loop on modules */
return NULL;
}
+
+void loader_reset()
+{
+ for (int i = 0; i < loader_data.numshlibs && loader_data.shlibs[i].name != NULL; i++) {
+ loader_shlibdesc_t *shlib = &loader_data.shlibs[i];
+ free(shlib->name);
+ free(shlib->thisshlib_path);
+ for (int j = 0; j < shlib->numfunc; ++j)
+ free(shlib->funcarray[j].fname);
+ free(shlib->funcarray);
+ shlib->numfunc = 0;
+ shlib->len_funcarray = 0;
+ }
+ free(loader_data.shlibs);
+}
diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h
index 0e80a5353c..8139c21909 100644
--- a/common/utils/load_module_shlib.h
+++ b/common/utils/load_module_shlib.h
@@ -47,6 +47,7 @@ typedef struct {
char *thisshlib_path;
uint32_t numfunc;
loader_shlibfunc_t *funcarray;
+ uint32_t len_funcarray;
}loader_shlibdesc_t;
typedef struct {
@@ -90,5 +91,6 @@ extern void * get_shlibmodule_fptr(char *modname, char *fname);
extern loader_data_t loader_data;
#endif /* LOAD_MODULE_SHLIB_MAIN */
#define load_module_shlib(M, F, N, I) load_module_version_shlib(M, NULL, F, N, I)
+void loader_reset();
#endif
diff --git a/common/utils/lte/ue_power.h b/common/utils/lte/ue_power.h
deleted file mode 100644
index caeebec2c8..0000000000
--- a/common/utils/lte/ue_power.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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 ue_power.h
-* \brief support routines used in MAC and PHY
-* \author R. Knopp, F. Kaltenberger
-* \date 2020
-* \version 0.1
-* \company Eurecom
-* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
-* \note
-* \warning
-*/
-
-int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
-
diff --git a/common/utils/msc/msc.c b/common/utils/msc/msc.c
deleted file mode 100644
index 84b723b022..0000000000
--- a/common/utils/msc/msc.c
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
- * 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 msc.c
- * \brief Message chart generator logging utility (generated files to processed by a script to produce a mscgen input file for generating a sequence diagram document)
- * \author Lionel GAUTHIER
- * \date 2015
- * \email: lionel.gauthier@eurecom.fr
- */
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define MSC_LIBRARY
-#include "msc.h"
-
-#include "liblfds611.h"
-#include "intertask_interface.h"
-
-
-
-#include "assertions.h"
-
-//-------------------------------
-#define MSC_MAX_QUEUE_ELEMENTS 1024
-#define MSC_MAX_PROTO_NAME_LENGTH 16
-#define MSC_MAX_MESSAGE_LENGTH 512
-
-//-------------------------------
-
-FILE *g_msc_fd;
-char g_msc_proto2str[MAX_MSC_PROTOS][MSC_MAX_PROTO_NAME_LENGTH];
-
-msc_interface_t msc_interface;
-
-typedef unsigned long msc_message_number_t;
-typedef struct msc_queue_item_s {
- char *message_str;
- uint32_t message_str_size;
- uint8_t *message_bin;
- uint32_t message_bin_size;
-} msc_queue_item_t;
-
-msc_message_number_t g_message_number = 0;
-struct lfds611_queue_state *g_msc_message_queue_p = NULL;
-struct lfds611_stack_state *g_msc_memory_stack_p = NULL;
-
-//------------------------------------------------------------------------------
-void *msc_task(void *args_p)
-//------------------------------------------------------------------------------
-{
- MessageDef *received_message_p = NULL;
- // const char *msg_name = NULL;
- // instance_t instance = 0;
- long timer_id;
- itti_mark_task_ready(TASK_MSC);
- msc_start_use();
- timer_setup(0, // seconds
- 50000, // usec
- TASK_MSC,
- INSTANCE_DEFAULT,
- TIMER_PERIODIC,
- NULL,
- &timer_id);
-
- while(1) {
- itti_receive_msg(TASK_MSC, &received_message_p);
-
- if (received_message_p != NULL) {
- // msg_name = ITTI_MSG_NAME (received_message_p);
- // instance = ITTI_MSG_DESTINATION_INSTANCE (received_message_p);
- switch (ITTI_MSG_ID(received_message_p)) {
- case TIMER_HAS_EXPIRED: {
- msc_flush_messages();
- }
- break;
-
- case TERMINATE_MESSAGE: {
- fprintf(stderr, " *** Exiting MSC thread\n");
- timer_remove(timer_id);
- msc_end();
- itti_exit_task();
- }
- break;
-
- case MESSAGE_TEST: {
- }
- break;
-
- default: {
- }
- break;
- }
- }
- }
-
- fprintf(stderr, "Task MSC exiting\n");
- return NULL;
-}
-
-//------------------------------------------------------------------------------
-int msc_init(const msc_env_t envP, const int max_threadsP)
-//------------------------------------------------------------------------------
-{
- int i;
- int rv;
- void *pointer_p;
- char msc_filename[256];
- fprintf(stderr, "Initializing MSC logs\n");
- rv = snprintf(msc_filename, 256, "/tmp/openair.msc.%i.log", envP); // TODO NAME
-
- if ((0 >= rv) || (256 < rv)) {
- fprintf(stderr, "Error in MSC log file name");
- }
-
- g_msc_fd = fopen(msc_filename,"w");
- AssertFatal(g_msc_fd != NULL, "Could not open MSC log file %s : %s", msc_filename, strerror(errno));
- rv = lfds611_stack_new(&g_msc_memory_stack_p, (lfds611_atom_t)max_threadsP + 2);
-
- if (0 >= rv) {
- AssertFatal (0, "lfds611_stack_new failed!\n");
- }
-
- rv = lfds611_queue_new(&g_msc_message_queue_p, (lfds611_atom_t)MSC_MAX_QUEUE_ELEMENTS);
- AssertFatal (rv, "lfds611_queue_new failed!\n");
- AssertFatal (g_msc_message_queue_p != NULL, "g_msc_message_queue_p is NULL!\n");
- msc_start_use();
-
- for (i=0; i < max_threadsP * 30; i++) {
- pointer_p = malloc(MSC_MAX_MESSAGE_LENGTH);
- AssertFatal (pointer_p, "malloc failed!\n");
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, pointer_p );
- AssertFatal (rv, "lfds611_stack_guaranteed_push failed for item %d\n", i);
- }
-
- for (i = MIN_MSC_PROTOS; i < MAX_MSC_PROTOS; i++) {
- switch (i) {
- case MSC_IP_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_IP_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "IP_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if (envP == MSC_E_UTRAN_LIPA) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_NAS_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_RRC_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_PDCP_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_RLC_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_MAC_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_PHY_UE:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_UE");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_PHY_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PHY_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_MAC_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MAC_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_RLC_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RLC_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_PDCP_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "PDCP_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_RRC_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "RRC_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_S1AP_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_GTPU_ENB:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_ENB");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_GTPU_SGW:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "GTPU_SGW");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_S1AP_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S1AP_MME");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME) || (envP == MSC_E_UTRAN) || (envP == MSC_E_UTRAN_LIPA)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_MMEAPP_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "MME_APP");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_NAS_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_MME");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- msc_log_declare_proto(i);
- break;
-
- case MSC_NAS_EMM_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_EMM");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_NAS_ESM_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "NAS_ESM");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_SP_GWAPP_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "SP_GW_MME");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if (envP == MSC_MME_GW) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_S11_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S11_MME");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if (envP == MSC_MME) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_S6A_MME:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "S6A");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
-
- case MSC_HSS:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "HSS");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
-
- if ((envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- }
-
- break;
- case MSC_F1AP_CU:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_CU");
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
- //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- //}
- break;
- case MSC_F1AP_DU:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "F1AP_DU");
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;}
- //if ((envP == MSC_E_UTRAN) || (envP == MSC_MME_GW) || (envP == MSC_MME)) {
- msc_log_declare_proto(i);
- //}
- break;
- default:
- rv = snprintf(&g_msc_proto2str[i][0], MSC_MAX_PROTO_NAME_LENGTH, "UNKNOWN");
-
- if (rv >= MSC_MAX_PROTO_NAME_LENGTH) {
- g_msc_proto2str[i][MSC_MAX_PROTO_NAME_LENGTH-1] = 0;
- }
- }
- }
-
- rv = itti_create_task (TASK_MSC, msc_task, NULL);
- AssertFatal (rv == 0, "Create task for MSC failed!\n");
- fprintf(stderr, "Initializing MSC logs Done\n");
- return 0;
-}
-
-//------------------------------------------------------------------------------
-void msc_start_use(void)
-//------------------------------------------------------------------------------
-{
- lfds611_queue_use(g_msc_message_queue_p);
- lfds611_stack_use(g_msc_memory_stack_p);
-}
-
-
-//------------------------------------------------------------------------------
-void msc_flush_messages(void)
-//------------------------------------------------------------------------------
-{
- int rv;
- msc_queue_item_t *item_p = NULL;
-
- while ((rv = lfds611_queue_dequeue( g_msc_message_queue_p, (void **)&item_p )) == 1) {
- if (NULL != item_p->message_str) {
- fputs(item_p->message_str, g_msc_fd);
- // TODO BIN DATA
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, item_p->message_str );
- }
-
- // TODO FREE BIN DATA
- free(item_p);
- }
-
- fflush(g_msc_fd);
-}
-
-
-//------------------------------------------------------------------------------
-void msc_end(void)
-//------------------------------------------------------------------------------
-{
- int rv;
-
- if (NULL != g_msc_fd ) {
- msc_flush_messages();
- rv = fflush(g_msc_fd);
-
- if (rv != 0) {
- fprintf(stderr, "Error while flushing stream of MSC log file: %s", strerror(errno));
- }
-
- rv = fclose(g_msc_fd);
-
- if (rv != 0) {
- fprintf(stderr, "Error while closing MSC log file: %s", strerror(errno));
- }
- }
-}
-
-//------------------------------------------------------------------------------
-void msc_log_declare_proto(
- const msc_proto_t protoP
-)
-//------------------------------------------------------------------------------
-{
- int rv = 0;
- msc_queue_item_t *new_item_p = NULL;
- char *char_message_p = NULL;
-
- if ((MIN_MSC_PROTOS <= protoP) && (MAX_MSC_PROTOS > protoP)) {
- // may be build a memory pool for that also ?
- new_item_p = malloc(sizeof(msc_queue_item_t));
-
- if (NULL != new_item_p) {
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
-
- if (0 == rv) {
- msc_flush_messages();
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
- }
-
- if (1 == rv) {
- rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [PROTO] %d %s\n", __sync_fetch_and_add (&g_message_number, 1), protoP, &g_msc_proto2str[protoP][0]);
-
- if (0 > rv) {
- fprintf(stderr, "Error while declaring new protocol in MSC: %s", strerror(errno));
- }
-
- new_item_p->message_str = char_message_p;
- new_item_p->message_str_size = rv;
- new_item_p->message_bin = NULL;
- new_item_p->message_bin_size = 0;
- rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
-
- if (0 == rv) {
- rv = lfds611_queue_guaranteed_enqueue(g_msc_message_queue_p, new_item_p );
-
- if (0 == rv) {
- fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
- free(new_item_p);
- }
- }
-
- return;
- } else {
- fprintf(stderr, "Error while lfds611_stack_pop()\n");
- }
-
- free(new_item_p);
- } else {
- fprintf(stderr, "Error while malloc in MSC");
- }
- }
-}
-//------------------------------------------------------------------------------
-void msc_log_event(
- const msc_proto_t protoP,
- char *format, ...)
-//------------------------------------------------------------------------------
-{
- va_list args;
- int rv;
- int rv2;
- msc_queue_item_t *new_item_p = NULL;
- char *char_message_p = NULL;
-
- if ((MIN_MSC_PROTOS > protoP) || (MAX_MSC_PROTOS <= protoP)) {
- return;
- }
-
- new_item_p = malloc(sizeof(msc_queue_item_t));
-
- if (NULL != new_item_p) {
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
-
- if (0 == rv) {
- msc_flush_messages();
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
- }
-
- if (1 == rv) {
- rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [EVENT] %d ", __sync_fetch_and_add (&g_message_number, 1), protoP);
-
- if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) {
- fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
- goto error_event;
- }
-
- va_start(args, format);
- rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args);
- va_end(args);
-
- if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
- fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
- goto error_event;
- }
-
- rv += rv2;
- rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n");
-
- if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
- fprintf(stderr, "Error while logging MSC event : %s", &g_msc_proto2str[protoP][0]);
- goto error_event;
- }
-
- rv += rv2;
- new_item_p->message_str = char_message_p;
- new_item_p->message_str_size = rv;
- new_item_p->message_bin = NULL;
- new_item_p->message_bin_size = 0;
- rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
-
- if (0 == rv) {
- fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
- free(new_item_p);
- }
- } else {
- fprintf(stderr, "Error while lfds611_stack_pop()\n");
- }
- }
-
- return;
-error_event:
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
- free(new_item_p);
-}
-//------------------------------------------------------------------------------
-void msc_log_message(
- const char *const message_operationP,
- const msc_proto_t proto1P,
- const msc_proto_t proto2P,
- const uint8_t *const bytesP,
- const unsigned int num_bytes,
- char *format, ...)
-//------------------------------------------------------------------------------
-{
- va_list args;
- uint64_t mac = 0; // TO DO mac on bytesP param
- int rv;
- int rv2;
- msc_queue_item_t *new_item_p = NULL;
- char *char_message_p = NULL;
-
- if ((MIN_MSC_PROTOS > proto1P) || (MAX_MSC_PROTOS <= proto1P) ||
- (MIN_MSC_PROTOS > proto2P) || (MAX_MSC_PROTOS <= proto2P) ) {
- return;
- }
-
- new_item_p = malloc(sizeof(msc_queue_item_t));
-
- if (NULL != new_item_p) {
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
-
- if (0 == rv) {
- msc_flush_messages();
- rv = lfds611_stack_pop(g_msc_memory_stack_p, (void **)&char_message_p);
- }
-
- if (1 == rv) {
- rv = snprintf(char_message_p, MSC_MAX_MESSAGE_LENGTH, "%"PRIu64" [MESSAGE] %d %s %d %"PRIu64" ",
- __sync_fetch_and_add (&g_message_number, 1), proto1P, message_operationP, proto2P, mac);
-
- if ((0 > rv) || (MSC_MAX_MESSAGE_LENGTH < rv)) {
- fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
- goto error_event;
- }
-
- va_start(args, format);
- rv2 = vsnprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, format, args);
- va_end(args);
-
- if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
- fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
- goto error_event;
- }
-
- rv += rv2;
- rv2 = snprintf(&char_message_p[rv],MSC_MAX_MESSAGE_LENGTH - rv, "\n");
-
- if ((0 > rv2) || ((MSC_MAX_MESSAGE_LENGTH - rv) < rv2)) {
- fprintf(stderr, "Error while logging MSC message : %s/%s", &g_msc_proto2str[proto1P][0], &g_msc_proto2str[proto2P][0]);
- goto error_event;
- }
-
- rv += rv2;
- new_item_p->message_str = char_message_p;
- new_item_p->message_str_size = rv;
- new_item_p->message_bin = NULL; // TO DO
- new_item_p->message_bin_size = 0; // TO DO
- rv = lfds611_queue_enqueue( g_msc_message_queue_p, new_item_p );
-
- if (0 == rv) {
- fprintf(stderr, "Error while lfds611_queue_guaranteed_enqueue message %s in MSC", char_message_p);
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
- free(new_item_p);
- }
- } else {
- fprintf(stderr, "Error while lfds611_stack_pop()\n");
- msc_flush_messages();
- }
- }
-
- return;
-error_event:
- rv = lfds611_stack_guaranteed_push( g_msc_memory_stack_p, char_message_p );
- free(new_item_p);
-}
-
-//------------------------------------------------------------------------------
-// function called when oai loader loads the msc shared lib
-int msc_autoinit(msc_interface_t *msc_interface)
-//------------------------------------------------------------------------------
-{
- msc_interface->msc_init = msc_init;
- msc_interface->msc_start_use = msc_start_use;
- msc_interface->msc_end = msc_end;
- msc_interface->msc_log_event = msc_log_event;
- msc_interface->msc_log_message = msc_log_message;
- msc_interface->msc_loaded = 1;
- return 0;
-}
diff --git a/common/utils/msc/msc.h b/common/utils/msc/msc.h
deleted file mode 100644
index adb0d9e657..0000000000
--- a/common/utils/msc/msc.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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
- */
-
-#ifndef MSC_H_
-#define MSC_H_
-#include
-#include
-
-typedef enum {
- MIN_MSC_ENV = 0,
- MSC_E_UTRAN = MIN_MSC_ENV,
- MSC_E_UTRAN_LIPA,
- MSC_MME_GW,
- MSC_MME,
- MSC_SP_GW,
- MAX_MSC_ENV
-} msc_env_t;
-
-
-typedef enum {
- MIN_MSC_PROTOS = 0,
- MSC_IP_UE = MIN_MSC_PROTOS,
- MSC_NAS_UE,
- MSC_RRC_UE,
- MSC_PDCP_UE,
- MSC_RLC_UE,
- MSC_MAC_UE,
- MSC_PHY_UE,
- MSC_PHY_ENB,
- MSC_MAC_ENB,
- MSC_RLC_ENB,
- MSC_PDCP_ENB,
- MSC_PDCP_GNB,
- MSC_RRC_ENB,
- MSC_RRC_GNB,
- MSC_IP_ENB,
- MSC_S1AP_ENB,
- MSC_NGAP_GNB,
- MSC_GTPU_ENB,
- MSC_GTPU_GNB,
- MSC_GTPU_SGW,
- MSC_S1AP_MME,
- MSC_NGAP_AMF,
- MSC_MMEAPP_MME,
- MSC_NAS_MME,
- MSC_NAS_EMM_MME,
- MSC_NAS_ESM_MME,
- MSC_SP_GWAPP_MME,
- MSC_S11_MME,
- MSC_S6A_MME,
- MSC_HSS,
- MSC_F1AP_CU,
- MSC_F1AP_DU,
- MSC_X2AP_SRC_ENB,
- MSC_X2AP_TARGET_ENB,
- MAX_MSC_PROTOS,
-} msc_proto_t;
-
-
-
-// Access stratum
-#define MSC_AS_TIME_FMT "%05u:%02u"
-
-#define MSC_AS_TIME_ARGS(CTXT_Pp) \
- (CTXT_Pp)->frame, \
- (CTXT_Pp)->subframe
-
-typedef int(*msc_init_t)(const msc_env_t, const int );
-typedef void(*msc_start_use_t)(void );
-typedef void(*msc_end_t)(void);
-typedef void(*msc_log_event_t)(const msc_proto_t,char *, ...);
-typedef void(*msc_log_message_t)(const char *const, const msc_proto_t, const msc_proto_t,
- const uint8_t *const, const unsigned int, char *, ...);
-typedef struct msc_interface {
- int msc_loaded;
- msc_init_t msc_init;
- msc_start_use_t msc_start_use;
- msc_end_t msc_end;
- msc_log_event_t msc_log_event;
- msc_log_message_t msc_log_message;
-} msc_interface_t;
-
-#ifdef MSC_LIBRARY
-int msc_init(const msc_env_t envP, const int max_threadsP);
-void msc_start_use(void);
-void msc_flush_messages(void);
-void msc_end(void);
-void msc_log_declare_proto(const msc_proto_t protoP);
-void msc_log_event(const msc_proto_t protoP,char *format, ...);
-void msc_log_message(
- const char *const message_operationP,
- const msc_proto_t receiverP,
- const msc_proto_t senderP,
- const uint8_t *const bytesP,
- const unsigned int num_bytes,
- char *format, ...);
-
-#else
-
-#define MESSAGE_CHART_GENERATOR msc_interface.msc_loaded
-
-extern msc_interface_t msc_interface;
-#define MSC_INIT(arg1,arg2) if(msc_interface.msc_loaded) msc_interface.msc_init(arg1,arg2)
-#define MSC_START_USE if(msc_interface.msc_loaded) msc_interface.msc_start_use
-#define MSC_END if(msc_interface.msc_loaded) msc_interface.msc_end
-#define MSC_LOG_EVENT(mScPaRaMs, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_event(mScPaRaMs, fORMAT, ##aRGS)
-#define MSC_LOG_RX_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("<-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
-#define MSC_LOG_RX_DISCARDED_MESSAGE(rECEIVER, sENDER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("x-",rECEIVER, sENDER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
-#define MSC_LOG_TX_MESSAGE(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("->",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
-#define MSC_LOG_TX_MESSAGE_FAILED(sENDER, rECEIVER, bYTES, nUMbYTES, fORMAT, aRGS...) if(msc_interface.msc_loaded) msc_interface.msc_log_message("-x",sENDER, rECEIVER, (const uint8_t *)bYTES, nUMbYTES, fORMAT, ##aRGS)
-#endif
-
-#endif
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index d823fcc1c4..b0a6266d34 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -231,7 +231,6 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) {
}
}
-
void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) {
uint8_t count=0, start=0, start_set=0;
@@ -483,6 +482,7 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
return i;
}
+
int get_subband_size(int NPRB,int size) {
// implements table 5.2.1.4-2 from 36.214
//
diff --git a/common/utils/ocp_itti/intertask_interface.h b/common/utils/ocp_itti/intertask_interface.h
index 3188e5889f..e595311b26 100644
--- a/common/utils/ocp_itti/intertask_interface.h
+++ b/common/utils/ocp_itti/intertask_interface.h
@@ -256,8 +256,8 @@ typedef struct IttiMsgText_s {
#include
//#include
-#include
-#include
+#include
+#include
void *rrc_enb_process_itti_msg(void *);
#include
#include
@@ -338,10 +338,7 @@ void *rrc_enb_process_msg(void *);
TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
- TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200, NULL, NULL)\
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
- TASK_DEF(OCP_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
- TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
@@ -560,7 +557,6 @@ MessageDef *itti_alloc_new_message_sized(
This function should be called from the main thread after having created all ITTI tasks.
**/
void itti_wait_tasks_end(void);
-#define ADDED_QUEUES_MAX 10 // Fix me: MSC component too hard to understand, we keep room for 10 queues created dynamically
void itti_set_task_real_time(task_id_t task_id);
/** \brief Send a termination message to all tasks.
diff --git a/common/utils/telnetsrv/DOC/telnetlog.md b/common/utils/telnetsrv/DOC/telnetlog.md
index 36c5cfb348..cb008fc8bb 100644
--- a/common/utils/telnetsrv/DOC/telnetlog.md
+++ b/common/utils/telnetsrv/DOC/telnetlog.md
@@ -62,7 +62,6 @@ component verbosity level enabled
16 PERF: medium info N
17 OIP: medium info N
18 CLI: medium info N
-19 MSC: medium info N
20 OCM: medium info N
21 UDP: medium info N
22 GTPV1U: medium info N
diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf
index 9d19207522..985f4eb378 100644
--- a/configuration/bladeRF/enb-band7-5mhz.conf
+++ b/configuration/bladeRF/enb-band7-5mhz.conf
@@ -206,19 +206,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="high";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="debug";
- rlc_log_verbosity ="high";
pdcp_log_level ="info";
- pdcp_log_verbosity ="high";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
@@ -267,17 +260,10 @@ RUs = (
log_config :
{
global_log_level ="info";
- global_log_verbosity ="high";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="high";
pdcp_log_level ="info";
- pdcp_log_verbosity ="high";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index 89d2ec8a2d..449859b042 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -155,6 +155,14 @@ At the UE the --sa flag will:
4) 5G-NR RRC Reconfiguration
5) Start Downlink and Uplink Data Transfer
+Command line parameters for UE in --sa mode:
+- `C` : downlink carrier frequency in Hz (default value 0)
+- `CO` : uplink frequency offset for FDD in Hz (default value 0)
+- `numerology` : numerology index (default value 1)
+- `r` : bandwidth in terms of RBs (default value 106)
+- `band` : NR band number (default value 78)
+- `s` : SSB start subcarrier (default value 512)
+
### Run OAI in SA mode
From the `cmake_targets/ran_build/build` folder:
@@ -179,21 +187,15 @@ Additionally, at UE side `--uecap_file` option can be used to pass the UE Capabi
## IF setup with OAI
-The -C and --CO flags can be used together at UE side to set custom downlink and uplink FR1 arbitrary frequencies for the IF equipment.
+OAI is also compatible with Intermediate Frequency (IF) equipment. This allows to use RF front-end that with arbitrary frequencies bands that do not comply with the standardised 3GPP NR bands.
-In order to run this setup, the following flags are needed at the UE side:
+To configure the IF frequencies it is necessary to use two command-line options at UE side:
+- `if_freq`, downlink frequency in Hz
+- `if_freq_off`, uplink frequency offset in Hz
-`-C`
-
-`--CO`
-
-and the following parameters must be configured in the RUs section of the gNB configuration file:
-
-`if_freq`
-
-`if_offset`
-
-The values must be given in Hz.
+Accordingly, the following parameters must be configured in the RUs section of the gNB configuration file:
+- `if_freq`
+- `if_offset`
### Run OAI with custom DL/UL arbitrary frequencies
@@ -207,7 +209,7 @@ gNB on machine 1:
UE on machine 2:
-`sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000`
+`sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000`
diff --git a/doc/SW_archi.md b/doc/SW_archi.md
index 0e77cfa580..7648fb2e16 100644
--- a/doc/SW_archi.md
+++ b/doc/SW_archi.md
@@ -369,7 +369,7 @@ gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the o
# New GTP
## initialization
-ocp_gtpv1uTask(): this creates only the thread, doesn't configure anything
+gtpv1uTask(): this creates only the thread, doesn't configure anything
gtpv1Init(): creates a listening socket to Linux for a given reception and select a local IP address
## newGtpuCreateTunnel()
diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md
index 048d8c86ff..f8c85bf2ca 100644
--- a/doc/TESTING_5GSA_setup.md
+++ b/doc/TESTING_5GSA_setup.md
@@ -169,8 +169,7 @@ MACRLCs = (
At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface, as well as some IP traffic tests over *F1-U* have been validated using the OAI gNB/nrUE in RFSIMULATOR mode.
-
-*These extensions are not yet fully integrated into develop branch, as they are under merge request. Until they get fully integrated, the CU/DU functionalities can be tested in [NR_F1C_F1U_extensions](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_F1C_F1U_extensions) branch.*
+
## 1.2 OAI 5G Core Network installation and configuration
The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using `docker-compose` can be found [here](https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/README.md).
@@ -264,12 +263,12 @@ the gNB can be launched in 2 modes:
1. Launch the CU component:
```bash
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \
- -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf
+ -O ../../../ci-scripts/conf_files/gNB_SA_CU.conf
```
2. Launch the DU component:
```bash
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa \
- -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
+ -O ../../../ci-scripts/conf_files/gNB_SA_DU.conf
```
- To launch the OAI UE (valid in `monolithic` gNB and `CU/DU split` gNB):
diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf
index a6bbd98bda..027b6f2499 100755
--- a/doc/testing_gnb_w_cots_ue_resources/enb.conf
+++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf
@@ -206,19 +206,12 @@ eNBs =
log_config :
{
global_log_level ="info";
- global_log_verbosity ="high";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="debug";
- rlc_log_verbosity ="high";
pdcp_log_level ="info";
- pdcp_log_verbosity ="high";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
}
@@ -267,17 +260,10 @@ RUs = (
log_config :
{
global_log_level ="info";
- global_log_verbosity ="high";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="high";
pdcp_log_level ="info";
- pdcp_log_verbosity ="high";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf
index aae22a92ba..c96d207445 100755
--- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf
+++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf
@@ -258,18 +258,11 @@ security = {
log_config :
{
global_log_level ="info";
- global_log_verbosity ="medium";
hw_log_level ="info";
- hw_log_verbosity ="medium";
phy_log_level ="info";
- phy_log_verbosity ="medium";
mac_log_level ="info";
- mac_log_verbosity ="high";
rlc_log_level ="info";
- rlc_log_verbosity ="medium";
pdcp_log_level ="info";
- pdcp_log_verbosity ="medium";
rrc_log_level ="info";
- rrc_log_verbosity ="medium";
};
diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log
index 9b9de24a86..7356c0c88d 100755
--- a/doc/testing_gnb_w_cots_ue_resources/oai_enb.log
+++ b/doc/testing_gnb_w_cots_ue_resources/oai_enb.log
@@ -62,7 +62,6 @@ ITTI init, useMME: 1
[0m[0m[TMR] Starting itti queue: TASK_RRC_UE as task 31
[0m[0m[TMR] Starting itti queue: TASK_NAS_UE as task 32
[0m[0m[TMR] Starting itti queue: TASK_RAL_UE as task 33
-[0m[0m[TMR] Starting itti queue: TASK_MSC as task 34
[0m[0m[TMR] Starting itti queue: TASK_GTPV1_U as task 35
[0m[0m[TMR] Starting itti queue: TASK_UDP as task 36
[0m[0m[TMR] Starting itti queue: TASK_CU_F1 as task 37
diff --git a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log
index 37b3c10516..3c76c0d0d6 100755
--- a/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log
+++ b/doc/testing_gnb_w_cots_ue_resources/oai_gnb.log
@@ -58,7 +58,6 @@ CPU Freq is 3.092986
[0m[0m[TMR] Starting itti queue: TASK_RRC_UE as task 31
[0m[0m[TMR] Starting itti queue: TASK_NAS_UE as task 32
[0m[0m[TMR] Starting itti queue: TASK_RAL_UE as task 33
-[0m[0m[TMR] Starting itti queue: TASK_MSC as task 34
[0m[0m[TMR] Starting itti queue: TASK_GTPV1_U as task 35
[0m[0m[TMR] Starting itti queue: TASK_UDP as task 36
[0m[0m[TMR] Starting itti queue: TASK_CU_F1 as task 37
diff --git a/docker/Dockerfile.phySim.rhel8.2 b/docker/Dockerfile.phySim.rhel8.2
index 9f4b27ec0e..2627a9eafd 100644
--- a/docker/Dockerfile.phySim.rhel8.2
+++ b/docker/Dockerfile.phySim.rhel8.2
@@ -31,11 +31,14 @@ RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
+#only install address sanitizer for this container, the others don't need it
+RUN yum install -y libasan
+
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
- ./build_oai --phy_simulators --ninja --verbose-ci
+ ./build_oai --phy_simulators --ninja --verbose-ci --sanitize-address
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim
@@ -85,6 +88,7 @@ COPY --from=phy-sim-build \
/lib64/liblapack.so.3 \
/lib64/libexslt.so.0 \
/lib64/libxslt.so.1 \
+ /usr/lib64/libasan.so.5 \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/libSIMU.so \
/oai-ran/cmake_targets/ran_build/build/libldpc.so \
diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py
index 3d037294e6..297c202a03 100644
--- a/docker/scripts/generateTemplate.py
+++ b/docker/scripts/generateTemplate.py
@@ -55,6 +55,7 @@ def main():
"rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.tm1.fr1.106PRB.usrpb210.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gnb.band78.sa.fr1.106PRB.usrpn310.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "gnb.sa.band66.fr1.106PRB.usrpn300.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gNB_SA_CU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"gNB_SA_DU.conf": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh
index 79d6c6dc37..aec5c48050 100755
--- a/docker/scripts/gnb_entrypoint.sh
+++ b/docker/scripts/gnb_entrypoint.sh
@@ -10,6 +10,7 @@ THREAD_PARALLEL_CONFIG=${THREAD_PARALLEL_CONFIG:-PARALLEL_SINGLE_THREAD}
if [[ -v USE_NSA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.nsa.tdd.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.tdd.conf $PREFIX/etc/gnb.conf; fi
+if [[ -v USE_SA_FDD_MONO ]]; then cp $PREFIX/etc/gnb.sa.fdd.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_CU ]]; then ln -s $PREFIX/etc/gnb.sa.cu.conf $PREFIX/etc/gnb.conf; fi
if [[ -v USE_SA_TDD_CU ]]; then cp $PREFIX/etc/gnb.sa.du.tdd.conf $PREFIX/etc/gnb.conf; fi
# Sometimes, the templates are not enough. We mount a conf file on $PREFIX/etc. It can be a template itself.
diff --git a/docker/scripts/gnb_parameters.yaml b/docker/scripts/gnb_parameters.yaml
index 2f150d394a..8547d48e67 100644
--- a/docker/scripts/gnb_parameters.yaml
+++ b/docker/scripts/gnb_parameters.yaml
@@ -94,6 +94,36 @@
- key: parallel_config
env: "@THREAD_PARALLEL_CONFIG@"
+ - filePrefix: gnb.sa.band66.fr1.106PRB.usrpn300.conf
+ outputfilename: "gnb.sa.fdd.conf"
+ config:
+ - key: Active_gNBs
+ env: "@GNB_NAME@"
+ - key: gNB_name
+ env: "@GNB_NAME@"
+ - key: mcc
+ env: "@MCC@"
+ - key: mnc
+ env: "@MNC@"
+ - key: mnc_length
+ env: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: sst
+ env: "@NSSAI_SST@"
+ - key: ipv4
+ env: "@AMF_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NG_AMF
+ env: "@GNB_NGA_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NG_AMF
+ env: "@GNB_NGA_IP_ADDRESS@"
+ - key: GNB_INTERFACE_NAME_FOR_NGU
+ env: "@GNB_NGU_IF_NAME@"
+ - key: GNB_IPV4_ADDRESS_FOR_NGU
+ env: "@GNB_NGU_IP_ADDRESS@"
+ - key: parallel_config
+ env: "@THREAD_PARALLEL_CONFIG@"
+
- filePrefix: gNB_SA_CU.conf
outputfilename: "gnb.sa.cu.conf"
config:
diff --git a/executables/nr-softmodem-common.h b/executables/nr-softmodem-common.h
index 45d7852adc..47fd816db5 100644
--- a/executables/nr-softmodem-common.h
+++ b/executables/nr-softmodem-common.h
@@ -104,7 +104,6 @@
#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_LOGV "Set the global log verbosity \n"
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
-#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n"
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
@@ -112,13 +111,11 @@
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------*/
-#define START_MSC softmodem_params.start_msc
#define CMDLINE_LOGPARAMS_DESC_NR { \
{"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}, \
- {"msc", CONFIG_HLP_MSC, PARAMFLAG_BOOL, uptr:&START_MSC, defintval:0, TYPE_UINT, 0}, \
}
#define CMDLINE_ONLINELOG_IDX 0
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index 5f57919645..6452036912 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -29,8 +29,6 @@
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
#include
-#include "msc.h"
-
#include "PHY/types.h"
#include "common/ran_context.h"
@@ -365,7 +363,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
//Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
if(is_x2ap_enabled() || AMF_MODE_ENABLED) {
- if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
+ if (itti_create_task (TASK_GTPV1_U, >pv1uTask, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1;
}
@@ -589,48 +587,21 @@ static void wait_nfapi_init(char *thread_name) {
}
void init_pdcp(void) {
+ uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
+ PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT:
+ LINK_ENB_PDCP_TO_GTPV1U_BIT;
+
if (!get_softmodem_params()->nsa) {
if (!NODE_IS_DU(RC.nrrrc[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;
-
- if (IS_SOFTMODEM_NOS1) {
- printf("IS_SOFTMODEM_NOS1 option enabled \n");
- pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
- }
-
+ pdcp_layer_init();
nr_pdcp_module_init(pdcp_initmask, 0);
-
- if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
- LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
- } else {
- LOG_I(PDCP, "node is gNB \n");
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
- }
- } else {
- LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
}
} else {
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;
-
- if (IS_SOFTMODEM_NOS1) {
- printf("IS_SOFTMODEM_NOS1 option enabled \n");
- pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
- }
-
nr_pdcp_module_init(pdcp_initmask, 0);
- pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
- pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
}
-
int main( int argc, char **argv ) {
int ru_id, CC_id = 0;
start_background_system();
@@ -684,7 +655,6 @@ int main( int argc, char **argv ) {
cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, tasks_info);
// initialize mscgen log after ITTI
- MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
init_opt();
if(PDCP_USE_NETLINK && !IS_SOFTMODEM_NOS1) {
netlink_init();
diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h
index 4190a6074b..834e89b403 100644
--- a/executables/nr-softmodem.h
+++ b/executables/nr-softmodem.h
@@ -5,7 +5,6 @@
#include "flexran_agent.h"
#include "PHY/defs_gNB.h"
-#include "proto_agent.h"
#define DEFAULT_DLF 2680000000
@@ -65,5 +64,6 @@ void init_gNB_afterRU(void);
extern int stop_L1L2(module_id_t gnb_id);
extern int restart_L1L2(module_id_t gnb_id);
+void init_pdcp(void);
#endif
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index c00804ac57..9c9ca4db4c 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -18,7 +18,8 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
-
+#define _GNU_SOURCE
+#include
#include
#include "executables/nr-uesoftmodem.h"
#include "PHY/phy_extern_nr_ue.h"
@@ -166,10 +167,10 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
}
// initialize all signal buffers
- init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag);
+ init_nr_ue_signal(ue, nb_connected_gNB);
// intialize transport
- init_nr_ue_transport(ue, abstraction_flag);
+ init_nr_ue_transport(ue);
// init N_TA offset
init_N_TA_offset(ue);
@@ -886,26 +887,13 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
}
int computeSamplesShift(PHY_VARS_NR_UE *UE) {
-
- // compute TO compensation that should be applied for this frame
- if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 &&
- UE->rx_offset > 0 ) {
- LOG_I(PHY,"!!!adjusting -1 samples!!! rx_offset == %d\n", UE->rx_offset);
- UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
- UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
- return -1 ;
+ int samples_shift = -(UE->rx_offset>>1);
+ UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
+ UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
+ if (samples_shift != 0) {
+ LOG_I(NR_PHY,"Adjusting frame in time by %i samples\n", samples_shift);
}
-
- if ( UE->rx_offset > UE->frame_parms.samples_per_frame/2 &&
- UE->rx_offset < UE->frame_parms.samples_per_frame ) {
- int rx_offset = UE->rx_offset - UE->frame_parms.samples_per_frame;
- LOG_I(PHY,"!!!adjusting +1 samples!!! rx_offset == %d\n", rx_offset);
- UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
- UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
- return 1;
- }
-
- return 0;
+ return samples_shift;
}
static inline int get_firstSymSamp(uint16_t slot, NR_DL_FRAME_PARMS *fp) {
diff --git a/executables/ocp-gnb.c b/executables/ocp-gnb.c
index 462a07c707..23fd3ae132 100644
--- a/executables/ocp-gnb.c
+++ b/executables/ocp-gnb.c
@@ -93,7 +93,6 @@ time_stats_t softmodem_stats_rx_sf; // total rx time
// not used but needed for link
openair0_config_t openair0_cfg[MAX_CARDS];
uint16_t slot_ahead=6;
-msc_interface_t msc_interface;
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
int flexran_agent_start(mid_t mod_id) {
diff --git a/executables/softmodem-common.c b/executables/softmodem-common.c
index 3e20081b18..12c60e98fd 100644
--- a/executables/softmodem-common.c
+++ b/executables/softmodem-common.c
@@ -45,7 +45,6 @@
static softmodem_params_t softmodem_params;
char *parallel_config=NULL;
char *worker_config=NULL;
-msc_interface_t msc_interface;
int usrp_tx_thread = 0;
uint8_t nfapi_mode=0;
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 9aca677473..16014c6024 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -171,21 +171,17 @@ extern int usrp_tx_thread;
#define CONFIG_HLP_NSA "Enable NSA mode \n"
#define CONFIG_HLP_FLOG "Enable online log \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_LOGV "Set the global log verbosity \n"
#define CONFIG_HLP_TELN "Start embedded telnet server \n"
-#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n"
#define CONFIG_FLOG_OPT "R"
#define CONFIG_LOGL_OPT "g"
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
-#define START_MSC softmodem_params.start_msc
#define CMDLINE_LOGPARAMS_DESC { \
{CONFIG_FLOG_OPT , CONFIG_HLP_FLOG, 0, uptr:&online_log_messages, defintval:1, TYPE_INT, 0}, \
{CONFIG_LOGL_OPT , 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}, \
{"log-mem", NULL, 0, strptr:(char **)&logmem_filename, defstrval:NULL, TYPE_STRING, 0}, \
{"telnetclt", NULL, 0, uptr:&start_telnetclt, defstrval:NULL, TYPE_UINT, 0}, \
}
@@ -250,7 +246,6 @@ typedef struct {
int chain_offset;
int numerology;
int band;
- unsigned int start_msc;
uint32_t clock_source;
uint32_t timing_source;
int hw_timing_advance;
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
index 9e051e0a48..5e381cc57b 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
@@ -444,7 +444,7 @@ typedef struct {
uint8_t pucch_resource_id;
uint8_t pdsch_to_harq_feedback_time_ind;
uint8_t n_dmrs_cdm_groups;
- uint8_t dmrs_ports[10];
+ uint16_t dmrs_ports;
uint8_t n_front_load_symb;
uint8_t tci_state;
fapi_nr_dl_srs_config_t srs_config;
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index 371deba3f2..58d649d011 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -25,6 +25,7 @@
#include
#include "assertions.h"
#include "SIMULATION/TOOLS/sim.h"
+#include "common/utils/load_module_shlib.h"
#include "PHY/CODING/nrLDPC_extern.h"
//#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h"
@@ -118,15 +119,13 @@ int test_ldpc(short No_iteration,
//short test_input[block_length];
unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
//short *c; //padded codeword
- unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS];
- unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS];
- unsigned char *test_input_bit;
+ unsigned char estimated_output[MAX_NUM_DLSCH_SEGMENTS][block_length];
+ memset(estimated_output, 0, sizeof(estimated_output));
unsigned char *channel_input[MAX_NUM_DLSCH_SEGMENTS];
- unsigned char *channel_output_uncoded[MAX_NUM_DLSCH_SEGMENTS];
unsigned char *channel_input_optim[MAX_NUM_DLSCH_SEGMENTS];
- double *channel_output;
- double *modulated_input[MAX_NUM_DLSCH_SEGMENTS];
- char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS];
+ //double channel_output[68 * 384];
+ double modulated_input[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 };
+ char channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS][68 * 384] = { 0 };
unsigned int i,j,trial=0;
short BG=0,nrows=0;//,ncols;
int no_punctured_columns,removed_bit;
@@ -155,24 +154,12 @@ int test_ldpc(short No_iteration,
// generate input block
for(j=0;j>(i&7);
- test_input_bit[i] = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments
- if (estimated_output_bit[j][i] != test_input_bit[i])
- {
+ unsigned char estoutputbit = (estimated_output[j][i/8]&(1<<(i&7)))>>(i&7);
+ unsigned char inputbit = (test_input[j][i/8]&(1<<(i&7)))>>(i&7); // Further correct for multiple segments
+ if (estoutputbit != inputbit)
*errors_bit = (*errors_bit) + 1;
- }
}
//if (*errors == 1000)
@@ -460,17 +441,8 @@ int test_ldpc(short No_iteration,
for(j=0;j0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", dci_est[0], dci_est[1], dci_est[2], dci_est[3]);
free(encoder_outputByte);
free(channel_output);
@@ -239,13 +245,13 @@ if (logFlag){
start_meas(&timeEncoder);
if (decoder_int16==1) {
- polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, currentPtr);
+ polar_encoder_fast((uint64_t *)testInput, encoderOutput, 0, 0, polarMessageType, testLength, aggregation_level);
//polar_encoder_fast((uint64_t*)testInput, (uint64_t*)encoderOutput,0,0,currentPtr);
} else { //0 --> PBCH, 1 --> DCI, -1 --> UCI
if (polarMessageType == 0)
- polar_encoder(testInput, encoderOutput, currentPtr);
+ polar_encoder(testInput, encoderOutput, polarMessageType, testLength, aggregation_level);
else if (polarMessageType == 1)
- polar_encoder_dci(testInput, encoderOutput, currentPtr, rnti);
+ polar_encoder_dci(testInput, encoderOutput, rnti, polarMessageType, testLength, aggregation_level);
}
stop_meas(&timeEncoder);
@@ -276,19 +282,20 @@ if (logFlag){
start_meas(&timeDecoder);
if (decoder_int16==1) {
- decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0, currentPtr);
+ decoderState = polar_decoder_int16(channelOutput_int16, (uint64_t *)estimatedOutput, 0,
+ polarMessageType, testLength, aggregation_level);
} else { //0 --> PBCH, 1 --> DCI, -1 --> UCI
if (polarMessageType == 0) {
- decoderState = polar_decoder(channelOutput,
- estimatedOutput,
- currentPtr,
- decoderListSize);
+ decoderState = polar_decoder(channelOutput,
+ estimatedOutput,
+ decoderListSize,
+ polarMessageType, testLength, aggregation_level);
} else if (polarMessageType == 1) {
- decoderState = polar_decoder_dci(channelOutput,
- estimatedOutput,
- currentPtr,
- decoderListSize,
- rnti);
+ decoderState = polar_decoder_dci(channelOutput,
+ estimatedOutput,
+ decoderListSize,
+ rnti,
+ polarMessageType, testLength, aggregation_level);
}
}
stop_meas(&timeDecoder);
@@ -334,9 +341,9 @@ if (logFlag){
decoderState=0;
nBitError=0;
blockErrorState=0;
- memset(testInput,0,sizeof(uint32_t) * testArrayLength);
+ memset(testInput,0,sizeof(uint32_t) * realArrayLength);
memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength);
- memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength);
+ memset(estimatedOutput,0,sizeof(uint32_t) * realArrayLength);
}
//Calculate error statistics for the SNR.
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c
index 461eb7d6f6..3a484ff991 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_crc_byte.c
@@ -29,12 +29,13 @@ uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){
uint8_t crcPolynomialSize = 24;
uint8_t temp1[crcPolynomialSize], temp2[crcPolynomialSize];
- uint8_t **crc_generator_matrix = malloc(payloadSizeBits * sizeof(uint8_t *));
+ uint8_t **crc_generator_matrix = malloc(payloadSizeBits*sizeof(uint8_t *) + payloadSizeBits*crcPolynomialSize*sizeof(uint8_t));
if (crc_generator_matrix)
for (int i = 0; i < payloadSizeBits; i++)
- crc_generator_matrix[i] = malloc(crcPolynomialSize * sizeof(uint8_t));
+ crc_generator_matrix[i] = ((uint8_t*)&crc_generator_matrix[payloadSizeBits])+i*crcPolynomialSize;
- for (int i = 0; i < crcPolynomialSize; i++) crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1];
+ for (int i = 0; i < crcPolynomialSize; i++)
+ crc_generator_matrix[payloadSizeBits-1][i]=crcPolynomialPattern[i+1];
for (int i = payloadSizeBits-2; i >= 0; i--){
for (int j = 0; j < crcPolynomialSize-1; j++) temp1[j]=crc_generator_matrix[i+1][j+1];
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
index 8fe115b23a..62ce034f59 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
@@ -39,19 +39,44 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "assertions.h"
+static inline void updateCrcChecksum2(int xlen,
+ int ylen,
+ uint8_t crcChecksum[xlen][ylen],
+ int gxlen,
+ int gylen,
+ uint8_t crcGen[gxlen][gylen],
+ uint8_t listSize,
+ uint32_t i2,
+ uint8_t len)
+{
+ for (uint8_t i = 0; i < listSize; i++) {
+ for (uint8_t j = 0; j < len; j++) {
+ crcChecksum[j][i+listSize] = ( (crcChecksum[j][i] + crcGen[i2][j]) % 2 );
+ }
+ }
+}
+
int8_t polar_decoder(double *input,
uint32_t *out,
- const t_nrPolar_params *polarParams,
- uint8_t listSize)
+ uint8_t listSize,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level
+ )
{
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true);
//Assumes no a priori knowledge.
- uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
- uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True
- uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True
- double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
- uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize);
- double *pathMetric = malloc(sizeof(double)*(2*listSize));
- uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True
+ uint8_t bit[polarParams->N][polarParams->n+1][2*listSize];
+ memset(bit,0,sizeof bit);
+ uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True
+ memset(bitUpdated,0,sizeof bitUpdated);
+ uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True
+ memset(llrUpdated,0,sizeof llrUpdated);
+ double llr[polarParams->N][polarParams->n+1][2*listSize];
+ uint8_t crcChecksum[polarParams->crcParityBits][2*listSize];
+ memset(crcChecksum,0,sizeof crcChecksum);
+ double pathMetric[2*listSize];
+ uint8_t crcState[2*listSize]; //0=False, 1=True
for (int i=0; i<(2*listSize); i++) {
pathMetric[i] = 0;
@@ -63,13 +88,8 @@ int8_t polar_decoder(double *input,
bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2);
}
- uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3
- uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2
-
- for (int i = 0; i < polarParams->K; i++) {
- extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t));
- tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t));
- }
+ uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3
+ uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2
for (int i=0; ipayloadBits; i++) {
for (int j=0; jcrcParityBits; j++) {
@@ -102,7 +122,7 @@ int8_t polar_decoder(double *input,
}
}
- double *d_tilde = malloc(sizeof(double) * polarParams->N);
+ double d_tilde[polarParams->N];
nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength);
for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j];
@@ -117,31 +137,33 @@ int8_t polar_decoder(double *input,
uint8_t listIndex[2*listSize], copyIndex;
for (uint16_t currentBit=0; currentBitN; currentBit++) {
- updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1));
+ updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated);
if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit.
- updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit);
+ updatePathMetric(pathMetric, currentListSize, 0, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr);
} else { //Information or CRC bit.
- updatePathMetric2(pathMetric, llr, currentListSize, currentBit);
+ updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr);
for (int i = 0; i < currentListSize; i++) {
- for (int j = 0; j < polarParams->N; j++) {
- for (int k = 0; k < (polarParams->n+1); k++) {
+ for (int j = 0; j < polarParams->N; j++) {
+ for (int k = 0; k < (polarParams->n+1); k++) {
bit[j][k][i+currentListSize]=bit[j][k][i];
llr[j][k][i+currentListSize]=llr[j][k][i];
}
- }
+ }
}
- for (int i = 0; i < currentListSize; i++) {
- bit[currentBit][0][i]=0;
- crcState[i+currentListSize]=crcState[i];
- }
+ for (int i = 0; i < currentListSize; i++) {
+ bit[currentBit][0][i]=0;
+ crcState[i+currentListSize]=crcState[i];
+ }
for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1;
bitUpdated[currentBit][0]=1;
- updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits);
+ updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum,
+ polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix,
+ currentListSize, nonFrozenBit, polarParams->crcParityBits);
currentListSize*=2;
//Keep only the best "listSize" number of entries.
@@ -246,14 +268,7 @@ int8_t polar_decoder(double *input,
if (decoderIterationCheck==0) {
//perror("[SCL polar decoder] All list entries have failed the CRC checks.");
- free(d_tilde);
- free(pathMetric);
- free(crcState);
- nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1));
- nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1));
- nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits);
- free(tempECGM);
- return(-1);
+ polarReturn(-1);
}
nonFrozenBit++;
@@ -282,33 +297,34 @@ int8_t polar_decoder(double *input,
}
}
- free(d_tilde);
- free(pathMetric);
- free(crcState);
- nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1));
- nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1));
- nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits);
- nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K);
- nr_free_uint8_2D_array(tempECGM, polarParams->K);
/*
* Return bits.
*/
nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out);
- return(0);
+
+ polarReturn 0;
}
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- const t_nrPolar_params *polarParams,
uint8_t listSize,
- uint16_t n_RNTI) {
- uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
- uint8_t **bitUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True
- uint8_t **llrUpdated = nr_alloc_uint8_2D_array(polarParams->N, (polarParams->n+1)); //0=False, 1=True
- double ***llr = nr_alloc_double_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
- uint8_t **crcChecksum = nr_alloc_uint8_2D_array(polarParams->crcParityBits, 2*listSize);
- double *pathMetric = malloc(sizeof(double)*(2*listSize));
- uint8_t *crcState = malloc(sizeof(uint8_t)*(2*listSize)); //0=False, 1=True
+ uint16_t n_RNTI,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level ) {
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true);
+
+ uint8_t bit[polarParams->N][polarParams->n+1][2*listSize];
+ memset(bit,0,sizeof bit);
+ uint8_t bitUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True
+ memset(bitUpdated,0,sizeof bitUpdated);
+ uint8_t llrUpdated[polarParams->N][polarParams->n+1]; //0=False, 1=True
+ memset(llrUpdated,0,sizeof llrUpdated);
+ double llr[polarParams->N][polarParams->n+1][2*listSize];
+ uint8_t crcChecksum[polarParams->crcParityBits][2*listSize];
+ memset(crcChecksum,0,sizeof crcChecksum);
+ double pathMetric[2*listSize];
+ uint8_t crcState[2*listSize]; //0=False, 1=True
uint8_t extended_crc_scrambling_pattern[polarParams->crcParityBits];
for (int i=0; i<(2*listSize); i++) {
@@ -321,13 +337,8 @@ int8_t polar_decoder_dci(double *input,
bitUpdated[i][0]=((polarParams->information_bit_pattern[i]+1) % 2);
}
- uint8_t **extended_crc_generator_matrix = malloc(polarParams->K * sizeof(uint8_t *)); //G_P3: K-by-P
- uint8_t **tempECGM = malloc(polarParams->K * sizeof(uint8_t *)); //G_P2: K-by-P
-
- for (int i = 0; i < polarParams->K; i++) {
- extended_crc_generator_matrix[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t));
- tempECGM[i] = malloc(polarParams->crcParityBits * sizeof(uint8_t));
- }
+ uint8_t extended_crc_generator_matrix[polarParams->K][polarParams->crcParityBits]; //G_P3: K-by-P
+ uint8_t tempECGM[polarParams->K][polarParams->crcParityBits]; //G_P2: K-by-P
for (int i=0; ipayloadBits; i++) {
for (int j=0; jcrcParityBits; j++) {
@@ -366,17 +377,19 @@ int8_t polar_decoder_dci(double *input,
extended_crc_scrambling_pattern[i]=(n_RNTI>>(23-i))&1;
}
- double *d_tilde = malloc(sizeof(double) * polarParams->N);
+ double d_tilde[polarParams->N];
nr_polar_rate_matching(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength);
- for (int j = 0; j < polarParams->N; j++) llr[j][polarParams->n][0]=d_tilde[j];
+ for (int j = 0; j < polarParams->N; j++)
+ llr[j][polarParams->n][0]=d_tilde[j];
/*
* SCL polar decoder.
*/
for (int i=0; icrcParityBits; i++) {
- for (int j=0; jcrcParityBits; j++) crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i];
+ for (int j=0; jcrcParityBits; j++)
+ crcChecksum[i][0]=crcChecksum[i][0]+polarParams->crc_generator_matrix[j][i];
crcChecksum[i][0]=(crcChecksum[i][0]%2);
}
@@ -388,12 +401,12 @@ int8_t polar_decoder_dci(double *input,
uint8_t listIndex[2*listSize], copyIndex;
for (uint16_t currentBit=0; currentBitN; currentBit++) {
- updateLLR(llr, llrUpdated, bit, bitUpdated, currentListSize, currentBit, 0, polarParams->N, (polarParams->n+1));
+ updateLLR(currentListSize, currentBit, 0, polarParams->N, polarParams->n+1, 2*listSize, llr, llrUpdated, bit, bitUpdated);
if (polarParams->information_bit_pattern[currentBit]==0) { //Frozen bit.
- updatePathMetric(pathMetric, llr, currentListSize, 0, currentBit);
+ updatePathMetric(pathMetric, currentListSize, 0, currentBit,polarParams->N, polarParams->n+1, 2*listSize, llr);
} else { //Information or CRC bit.
- updatePathMetric2(pathMetric, llr, currentListSize, currentBit);
+ updatePathMetric2(pathMetric, currentListSize, currentBit, polarParams->N, polarParams->n+1, 2*listSize, llr);
for (int i = 0; i < currentListSize; i++) {
for (int j = 0; j < polarParams->N; j++) {
@@ -412,7 +425,9 @@ int8_t polar_decoder_dci(double *input,
for (int i = currentListSize; i < 2*currentListSize; i++) bit[currentBit][0][i]=1;
bitUpdated[currentBit][0]=1;
- updateCrcChecksum2(crcChecksum, extended_crc_generator_matrix, currentListSize, nonFrozenBit, polarParams->crcParityBits);
+ updateCrcChecksum2(polarParams->crcParityBits, 2*listSize, crcChecksum,
+ polarParams->K, polarParams->crcParityBits, extended_crc_generator_matrix,
+ currentListSize, nonFrozenBit, polarParams->crcParityBits);
currentListSize*=2;
//Keep only the best "listSize" number of entries.
@@ -513,18 +528,12 @@ int8_t polar_decoder_dci(double *input,
}
}
- for (uint8_t i = 0; i < currentListSize; i++) decoderIterationCheck+=crcState[i];
+ for (uint8_t i = 0; i < currentListSize; i++)
+ decoderIterationCheck+=crcState[i];
if (decoderIterationCheck==0) {
//perror("[SCL polar decoder] All list entries have failed the CRC checks.");
- free(d_tilde);
- free(pathMetric);
- free(crcState);
- nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1));
- nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1));
- nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits);
- free(tempECGM);
- return(-1);
+ polarReturn -1;
}
nonFrozenBit++;
@@ -553,19 +562,12 @@ int8_t polar_decoder_dci(double *input,
}
}
- free(d_tilde);
- free(pathMetric);
- free(crcState);
- nr_free_uint8_3D_array(bit, polarParams->N, (polarParams->n+1));
- nr_free_double_3D_array(llr, polarParams->N, (polarParams->n+1));
- nr_free_uint8_2D_array(crcChecksum, polarParams->crcParityBits);
- nr_free_uint8_2D_array(extended_crc_generator_matrix, polarParams->K);
- nr_free_uint8_2D_array(tempECGM, polarParams->K);
/*
* Return bits.
*/
nr_byte2bit_uint8_32(polarParams->nr_polar_A, polarParams->payloadBits, out);
- return(0);
+
+ polarReturn 0;
}
void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) {
@@ -604,8 +606,11 @@ void init_polar_deinterleaver_table(t_nrPolar_params *polarParams) {
uint32_t polar_decoder_int16(int16_t *input,
uint64_t *out,
uint8_t ones_flag,
- const t_nrPolar_params *polarParams)
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level )
{
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, true);
int16_t d_tilde[polarParams->N];// = malloc(sizeof(double) * polarParams->N);
nr_polar_rate_matching_int16(input, d_tilde, polarParams->rate_matching_pattern, polarParams->K, polarParams->N, polarParams->encoderLength);
@@ -702,5 +707,6 @@ uint32_t polar_decoder_int16(int16_t *input,
rxcrc,polarParams->payloadBits);
#endif
out[0]=Ar;
- return(crc^rxcrc);
+
+ polarReturn crc^rxcrc;
}
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
index 42d500ae86..b201db2ba6 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
@@ -36,51 +36,25 @@
//#define DEBUG_NEW_IMPL 1
-void updateLLR(double ***llr,
- uint8_t **llrU,
- uint8_t ***bit,
- uint8_t **bitU,
- uint8_t listSize,
- uint16_t row,
- uint16_t col,
- uint16_t xlen,
- uint8_t ylen)
-{
- uint16_t offset = (xlen/(pow(2,(ylen-col-1))));
- for (uint8_t i=0; i= offset ) {
- if(bitU[row-offset][col]==0) updateBit(bit, bitU, listSize, (row-offset), col, xlen, ylen);
- if(llrU[row-offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row-offset), (col+1), xlen, ylen);
- if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen);
- llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i];
- } else {
- if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen);
- if(llrU[row+offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row+offset), (col+1), xlen, ylen);
- computeLLR(llr, row, col, i, offset);
- }
- }
- llrU[row][col]=1;
- // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]);
-}
-
-void updateBit(uint8_t ***bit,
- uint8_t **bitU,
- uint8_t listSize,
- uint16_t row,
- uint16_t col,
- uint16_t xlen,
- uint8_t ylen)
+static inline void updateBit(uint8_t listSize,
+ uint16_t row,
+ uint16_t col,
+ uint16_t xlen,
+ uint8_t ylen,
+ int zlen,
+ uint8_t bit[xlen][ylen][zlen],
+ uint8_t bitU[xlen][ylen])
{
uint16_t offset = ( xlen/(pow(2,(ylen-col))) );
for (uint8_t i=0; i= offset ) {
- if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen);
+ if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU);
bit[row][col][i] = bit[row][col-1][i];
} else {
- if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen);
- if (bitU[row+offset][col-1]==0) updateBit(bit, bitU, listSize, (row+offset), (col-1), xlen, ylen);
+ if (bitU[row][col-1]==0) updateBit(listSize, row, (col-1), xlen, ylen, zlen, bit, bitU);
+ if (bitU[row+offset][col-1]==0) updateBit(listSize, (row+offset), (col-1), xlen, ylen, zlen, bit, bitU);
bit[row][col][i] = ( (bit[row][col-1][i]+bit[row+offset][col-1][i]) % 2);
}
}
@@ -88,11 +62,60 @@ void updateBit(uint8_t ***bit,
bitU[row][col]=1;
}
+static inline void computeLLR(uint16_t row,
+ uint16_t col,
+ uint8_t i,
+ uint16_t offset,
+ int xlen,
+ int ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen])
+{
+ double a = llr[row][col + 1][i];
+ double b = llr[row + offset][col + 1][i];
+ llr[row][col][i] = log((exp(a + b) + 1) / (exp(a) + exp(b))); //eq. (8a)
+}
+
+
+void updateLLR(uint8_t listSize,
+ uint16_t row,
+ uint16_t col,
+ uint16_t xlen,
+ uint8_t ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen],
+ uint8_t llrU[xlen][ylen],
+ uint8_t bit[xlen][ylen][zlen],
+ uint8_t bitU[xlen][ylen]
+ )
+{
+ uint16_t offset = (xlen/(pow(2,(ylen-col-1))));
+ for (uint8_t i=0; i= offset ) {
+ if(bitU[row-offset][col]==0) updateBit(listSize, (row-offset), col, xlen, ylen, zlen, bit, bitU);
+ if(llrU[row-offset][col+1]==0) updateLLR(listSize, (row-offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU );
+ if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU);
+ llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i];
+ } else {
+ if(llrU[row][col+1]==0) updateLLR(listSize, row, (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU );
+ if(llrU[row+offset][col+1]==0) updateLLR(listSize, (row+offset), (col+1), xlen, ylen, zlen, llr, llrU, bit, bitU );
+ computeLLR(row, col, i, offset, xlen, ylen, zlen, llr);
+ }
+ }
+ llrU[row][col]=1;
+
+ // printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]);
+}
+
void updatePathMetric(double *pathMetric,
- double ***llr,
- uint8_t listSize,
- uint8_t bitValue,
- uint16_t row)
+ uint8_t listSize,
+ uint8_t bitValue,
+ uint16_t row,
+ int xlen,
+ int ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen]
+ )
{
int8_t multiplier = (2*bitValue) - 1;
for (uint8_t i=0; ileft)
+ delete_nodes(n->left);
+ if(n->right)
+ delete_nodes(n->right);
+ free(n->alpha);
+ free(n->beta);
+ free(n);
+ }
+}
+
+void delete_decoder_tree(t_nrPolar_params *polarParams) {
+ if (polarParams->tree.root)
+ delete_nodes(polarParams->tree.root);
+}
+
void build_decoder_tree(t_nrPolar_params *polarParams)
{
polarParams->tree.num_nodes=0;
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
index c2e9fd9381..79af311e45 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
@@ -79,9 +79,10 @@ typedef struct decoder_tree_t_s {
struct nrPolar_params {
//messageType: 0=PBCH, 1=DCI, -1=UCI
- int idx; //idx = (messageType * messageLength * aggregation_prime);
- struct nrPolar_params *nextPtr;
+ struct nrPolar_params *nextPtr __attribute__((aligned(16)));
+ bool busy;
+ uint32_t idx;
uint8_t n_max;
uint8_t i_il;
uint8_t i_seg;
@@ -138,34 +139,46 @@ typedef struct nrPolar_params t_nrPolar_params;
void polar_encoder(uint32_t *input,
uint32_t *output,
- const t_nrPolar_params *polarParams);
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- const t_nrPolar_params *polarParams,
- uint16_t n_RNTI);
+ uint16_t n_RNTI,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- const t_nrPolar_params *polarParams);
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
int8_t polar_decoder(double *input,
uint32_t *output,
- const t_nrPolar_params *polarParams,
- uint8_t listSize);
+ uint8_t listSize,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
uint32_t polar_decoder_int16(int16_t *input,
uint64_t *out,
uint8_t ones_flag,
- const t_nrPolar_params *polarParams);
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- const t_nrPolar_params *polarParams,
uint8_t listSize,
- uint16_t n_RNTI);
+ uint16_t n_RNTI,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level);
void generic_polar_decoder(const t_nrPolar_params *pp,
decoder_node_t *node);
@@ -183,13 +196,12 @@ void build_decoder_tree(t_nrPolar_params *pp);
void build_polar_tables(t_nrPolar_params *polarParams);
void init_polar_deinterleaver_table(t_nrPolar_params *polarParams);
-void nr_polar_print_polarParams(t_nrPolar_params *polarParams);
+void nr_polar_print_polarParams(void);
t_nrPolar_params *nr_polar_params (int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level,
- int decoder_flag,
- t_nrPolar_params **polarList_ext);
+ int decoder_flag);
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level);
@@ -278,34 +290,6 @@ void nr_matrix_multiplication_uint8_1D_uint8_2D(uint8_t *matrix1,
uint16_t row,
uint16_t col);
-uint8_t ***nr_alloc_uint8_3D_array(uint16_t xlen,
- uint16_t ylen,
- uint16_t zlen);
-
-uint8_t **nr_alloc_uint8_2D_array(uint16_t xlen,
- uint16_t ylen);
-
-double ***nr_alloc_double_3D_array(uint16_t xlen,
- uint16_t ylen,
- uint16_t zlen);
-
-double **nr_alloc_double_2D_array(uint16_t xlen,
- uint16_t ylen);
-
-void nr_free_double_3D_array(double ***input,
- uint16_t xlen,
- uint16_t ylen);
-
-void nr_free_double_2D_array(double **input,
- uint16_t xlen);
-
-void nr_free_uint8_3D_array(uint8_t ***input,
- uint16_t xlen,
- uint16_t ylen);
-
-void nr_free_uint8_2D_array(uint8_t **input,
- uint16_t xlen);
-
void nr_sort_asc_double_1D_array_ind(double *matrix,
uint8_t *ind,
uint8_t len);
@@ -316,52 +300,33 @@ void nr_sort_asc_int16_1D_array_ind(int32_t *matrix,
void nr_free_double_2D_array(double **input, uint16_t xlen);
-void updateLLR(double ***llr,
- uint8_t **llrU,
- uint8_t ***bit,
- uint8_t **bitU,
- uint8_t listSize,
- uint16_t row,
- uint16_t col,
- uint16_t xlen,
- uint8_t ylen);
-
-void updateBit(uint8_t ***bit,
- uint8_t **bitU,
- uint8_t listSize,
- uint16_t row,
- uint16_t col,
- uint16_t xlen,
- uint8_t ylen);
-
+void updateLLR(uint8_t listSize,
+ uint16_t row,
+ uint16_t col,
+ uint16_t xlen,
+ uint8_t ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen],
+ uint8_t llrU[xlen][ylen],
+ uint8_t bit[xlen][ylen][zlen],
+ uint8_t bitU[xlen][ylen]
+ );
void updatePathMetric(double *pathMetric,
- double ***llr,
- uint8_t listSize,
- uint8_t bitValue,
- uint16_t row);
-
+ uint8_t listSize,
+ uint8_t bitValue,
+ uint16_t row,
+ int xlen,
+ int ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen]
+ );
void updatePathMetric2(double *pathMetric,
- double ***llr,
- uint8_t listSize,
- uint16_t row);
-
-void computeLLR(double ***llr,
- uint16_t row,
- uint16_t col,
- uint8_t i,
- uint16_t offset);
-
-void updateCrcChecksum(uint8_t **crcChecksum,
- uint8_t **crcGen,
- uint8_t listSize,
- uint32_t i2,
- uint8_t len);
-
-void updateCrcChecksum2(uint8_t **crcChecksum,
- uint8_t **crcGen,
- uint8_t listSize,
- uint32_t i2,
- uint8_t len);
+ uint8_t listSize,
+ uint16_t row,
+ int xlen,
+ int ylen,
+ int zlen,
+ double llr[xlen][ylen][zlen]);
//Also nr_polar_rate_matcher
static inline void nr_polar_interleaver(uint8_t *input,
@@ -379,5 +344,13 @@ static inline void nr_polar_deinterleaver(uint8_t *input,
{
for (int i=0; ibusy=false; \
+pthread_mutex_unlock(&PolarListMutex); \
+return
#endif
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
index 1dfaed8b94..4cba3fe078 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
@@ -43,7 +43,10 @@
void polar_encoder(uint32_t *in,
uint32_t *out,
- const t_nrPolar_params *polarParams) {
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level) {
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false);
if (1) {//polarParams->idx == 0 || polarParams->idx == 1) { //PBCH or PDCCH
/*
uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits);
@@ -57,10 +60,10 @@ void polar_encoder(uint32_t *in,
*/
//Calculate CRC.
nr_matrix_multiplication_uint8_1D_uint8_2D(polarParams->nr_polar_A,
- polarParams->crc_generator_matrix,
- polarParams->nr_polar_crc,
- polarParams->payloadBits,
- polarParams->crcParityBits);
+ polarParams->crc_generator_matrix,
+ polarParams->nr_polar_crc,
+ polarParams->payloadBits,
+ polarParams->crcParityBits);
for (uint8_t i = 0; i < polarParams->crcParityBits; i++)
polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
@@ -150,12 +153,19 @@ void polar_encoder(uint32_t *in,
#endif
nr_byte2bit_uint8_32(polarParams->nr_polar_E, polarParams->encoderLength, out);
+
+ polarReturn;
+
}
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- const t_nrPolar_params *polarParams,
- uint16_t n_RNTI) {
+ uint16_t n_RNTI,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level) {
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false);
+
#ifdef DEBUG_POLAR_ENCODER_DCI
printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]);
#endif
@@ -249,6 +259,7 @@ void polar_encoder_dci(uint32_t *in,
printf("\n[polar_encoder_dci] out: ");
for (int i = 0; i < outputInd; i++) printf("[%d]->0x%08x\t", i, out[i]);
#endif
+ polarReturn;
}
static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline));
@@ -334,7 +345,7 @@ void build_polar_tables(t_nrPolar_params *polarParams) {
AssertFatal(polarParams->N==512 || polarParams->N==256 || polarParams->N==128,"N = %d, not done yet\n",polarParams->N);
// build G bit vectors for information bit positions and convert the bit as bytes tables in nr_polar_kronecker_power_matrices.c to 64 bit packed vectors.
// keep only rows of G which correspond to information/crc bits
- polarParams->G_N_tab = (uint64_t **)malloc((polarParams->K + polarParams->n_pc) * sizeof(int64_t *));
+ polarParams->G_N_tab = (uint64_t **)calloc((polarParams->K + polarParams->n_pc),sizeof(int64_t *));
int k=0;
for (int i=0; iN; i++) {
@@ -418,11 +429,14 @@ void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- const t_nrPolar_params *polarParams) {
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level) {
+
+ t_nrPolar_params *polarParams=nr_polar_params(messageType, messageLength, aggregation_level, false);
// AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits);
- uint64_t B[4]= {0,0,0,0},Cprime[4]= {0,0,0,0};
int bitlen = polarParams->payloadBits;
// append crc
AssertFatal(bitlen<129,"support for payloads <= 128 bits\n");
@@ -451,9 +465,12 @@ void polar_encoder_fast(uint64_t *A,
A32_flip[1+offset]=((uint8_t *)&Aprime)[2];
A32_flip[2+offset]=((uint8_t *)&Aprime)[1];
A32_flip[3+offset]=((uint8_t *)&Aprime)[0];
- if (polarParams->crcParityBits == 24) tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff);
- else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff);
- else if (polarParams->crcParityBits == 6) tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f);
+ if (polarParams->crcParityBits == 24)
+ tcrc = (uint64_t)(((crcmask^(crc24c(A32_flip,8*offset+bitlen)>>8)))&0xffffff);
+ else if (polarParams->crcParityBits == 11)
+ tcrc = (uint64_t)(((crcmask^(crc11(A32_flip,bitlen)>>21)))&0x7ff);
+ else if (polarParams->crcParityBits == 6)
+ tcrc = (uint64_t)(((crcmask^(crc6(A32_flip,bitlen)>>26)))&0x3f);
} else if (bitlen<=64) {
uint8_t A64_flip[8+offset];
if (ones_flag) {
@@ -470,8 +487,10 @@ void polar_encoder_fast(uint64_t *A,
A64_flip[5+offset]=((uint8_t *)&Aprime)[2];
A64_flip[6+offset]=((uint8_t *)&Aprime)[1];
A64_flip[7+offset]=((uint8_t *)&Aprime)[0];
- if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff;
- else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff;
+ if (polarParams->crcParityBits == 24)
+ tcrc = (uint64_t)((crcmask^(crc24c(A64_flip,8*offset+bitlen)>>8)))&0xffffff;
+ else if (polarParams->crcParityBits == 11)
+ tcrc = (uint64_t)((crcmask^(crc11(A64_flip,bitlen)>>21)))&0x7ff;
}
else if (bitlen<=128) {
uint8_t A128_flip[16+offset];
@@ -481,38 +500,37 @@ void polar_encoder_fast(uint64_t *A,
A128_flip[2] = 0xff;
}
uint128_t Aprime= (uint128_t)(((uint128_t)*A)<<(128-bitlen));
- A128_flip[0+offset]=((uint8_t*)&Aprime)[15]; A128_flip[1+offset]=((uint8_t*)&Aprime)[14];
- A128_flip[2+offset]=((uint8_t*)&Aprime)[13]; A128_flip[3+offset]=((uint8_t*)&Aprime)[12];
- A128_flip[4+offset]=((uint8_t*)&Aprime)[11]; A128_flip[5+offset]=((uint8_t*)&Aprime)[10];
- A128_flip[6+offset] =((uint8_t*)&Aprime)[9]; A128_flip[7+offset] =((uint8_t*)&Aprime)[8];
- A128_flip[8+offset] =((uint8_t*)&Aprime)[7]; A128_flip[9+offset] =((uint8_t*)&Aprime)[6];
- A128_flip[10+offset]=((uint8_t*)&Aprime)[5]; A128_flip[11+offset]=((uint8_t*)&Aprime)[4];
- A128_flip[12+offset]=((uint8_t*)&Aprime)[3]; A128_flip[13+offset]=((uint8_t*)&Aprime)[2];
- A128_flip[14+offset]=((uint8_t*)&Aprime)[1]; A128_flip[15+offset]=((uint8_t*)&Aprime)[0];
- if (polarParams->crcParityBits == 24) tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff;
- else if (polarParams->crcParityBits == 11) tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff;
+ for (int i=0; i<16 ; i++)
+ A128_flip[i+offset]=((uint8_t*)&Aprime)[15-i];
+ if (polarParams->crcParityBits == 24)
+ tcrc = (uint64_t)((crcmask^(crc24c(A128_flip,8*offset+bitlen)>>8)))&0xffffff;
+ else if (polarParams->crcParityBits == 11)
+ tcrc = (uint64_t)((crcmask^(crc11(A128_flip,bitlen)>>21)))&0x7ff;
}
int n;
// this is number of quadwords in the bit string
- int quadwlen = (polarParams->K>>6);
-
- if ((polarParams->K&63) > 0) quadwlen++;
+ int quadwlen = (polarParams->K+63)/64;
// Create the B bit string as
// 0, 0, ..., 0, a'_0, a'_1, ..., a'_A-1, p_0, p_1, ..., p_{N_parity-1}
//??? b_{N'-1} b_{N'-2} ... b_{N'-A} b_{N'-A-1} ... b_{N'-A-Nparity} = a_{N-1} a_{N-2} ... a_{N-A} p_{N_parity-1} ... p_0
-
- for (n=0; ncrcParityBits) | tcrc;
- else B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits));
+ uint64_t B[4]= {0};
+ B[0] = (A[0] << polarParams->crcParityBits) | tcrc;
+ for (n=1; n n)
+ B[n] = (A[n] << polarParams->crcParityBits) | (A[n-1]>>(64-polarParams->crcParityBits));
+ else
+ B[n] = (A[n-1]>>(64-polarParams->crcParityBits));
uint8_t *Bbyte = (uint8_t *)B;
// for each byte of B, lookup in corresponding table for 64-bit word corresponding to that byte and its position
+ uint64_t Cprime[4]= {0};
if (polarParams->K<65)
Cprime[0] = polarParams->cprime_tab0[0][Bbyte[0]] |
- polarParams->cprime_tab0[1][Bbyte[1]] |
+ polarParams->cprime_tab0[1][Bbyte[1]] |
polarParams->cprime_tab0[2][Bbyte[2]] |
polarParams->cprime_tab0[3][Bbyte[3]] |
polarParams->cprime_tab0[4][Bbyte[4]] |
@@ -684,4 +702,7 @@ void polar_encoder_fast(uint64_t *A,
}
memset((void*)out,0,polarParams->encoderLength>>3);
polar_rate_matching(polarParams,(void *)D, out);
+
+ polarReturn;
+
}
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c
index c4c68e4e0e..ffeacb6be1 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c
@@ -43,163 +43,6 @@ void nr_matrix_multiplication_uint8_1D_uint8_2D(uint8_t *matrix1, uint8_t **matr
}
}
-uint8_t ***nr_alloc_uint8_3D_array(uint16_t xlen, uint16_t ylen, uint16_t zlen) {
- uint8_t ***output;
- int i, j;
-
- if ((output = malloc(xlen * sizeof(*output))) == NULL) {
- perror("[nr_alloc_uint8_3D_array] Problem at 1D allocation");
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- output[i] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- if ((output[i] = malloc(ylen * sizeof *output[i])) == NULL) {
- perror("[nr_alloc_uint8_3D_array] Problem at 2D allocation");
- nr_free_uint8_3D_array(output, xlen, ylen);
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- output[i][j] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- if ((output[i][j] = malloc(zlen * sizeof *output[i][j])) == NULL) {
- perror("[nr_alloc_uint8_3D_array] Problem at 3D allocation");
- nr_free_uint8_3D_array(output, xlen, ylen);
- return NULL;
- }
-
- return output;
-}
-
-uint8_t **nr_alloc_uint8_2D_array(uint16_t xlen, uint16_t ylen) {
- uint8_t **output;
- int i, j;
-
- if ((output = malloc(xlen * sizeof(*output))) == NULL) {
- perror("[nr_alloc_uint8_2D_array] Problem at 1D allocation");
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- output[i] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- if ((output[i] = malloc(ylen * sizeof *output[i])) == NULL) {
- perror("[nr_alloc_uint8_2D_array] Problem at 2D allocation");
- nr_free_uint8_2D_array(output, xlen);
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- output[i][j] = 0;
-
- return output;
-}
-
-double ***nr_alloc_double_3D_array(uint16_t xlen, uint16_t ylen, uint16_t zlen) {
- double ***output;
- int i, j;
-
- if ((output = malloc(xlen * sizeof(*output))) == NULL) {
- perror("[nr_alloc_double_3D_array] Problem at 1D allocation");
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- output[i] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- if ((output[i] = malloc(ylen * sizeof *output[i])) == NULL) {
- perror("[nr_alloc_double_3D_array] Problem at 2D allocation");
- nr_free_double_3D_array(output, xlen, ylen);
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- output[i][j] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- if ((output[i][j] = malloc(zlen * sizeof *output[i][j])) == NULL) {
- perror("[nr_alloc_double_3D_array] Problem at 3D allocation");
- nr_free_double_3D_array(output, xlen, ylen);
- return NULL;
- }
-
- return output;
-}
-
-double **nr_alloc_double_2D_array(uint16_t xlen, uint16_t ylen) {
- double **output;
- int i, j;
-
- if ((output = malloc(xlen * sizeof(*output))) == NULL) {
- perror("[nr_alloc_double_3D_array] Problem at 1D allocation");
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- output[i] = NULL;
-
-
- for (i = 0; i < xlen; i++)
- if ((output[i] = malloc(ylen * sizeof *output[i])) == NULL) {
- perror("[nr_alloc_double_2D_array] Problem at 2D allocation");
- nr_free_double_2D_array(output, xlen);
- return NULL;
- }
- for (i = 0; i < xlen; i++)
- for (j = 0; j < ylen; j++)
- output[i][j] = 0;
-
-
- return output;
-}
-
-void nr_free_double_3D_array(double ***input, uint16_t xlen, uint16_t ylen) {
- int i, j;
-
- for (i = 0; i < xlen; i++) {
- for (j = 0; j < ylen; j++) {
- free(input[i][j]);
- }
- free(input[i]);
- }
- free(input);
-}
-
-void nr_free_double_2D_array(double **input, uint16_t xlen) {
- int i;
-
- for (i = 0; i < xlen; i++) {
- free(input[i]);
- }
- free(input);
-}
-
-void nr_free_uint8_3D_array(uint8_t ***input, uint16_t xlen, uint16_t ylen) {
- int i, j;
-
- for (i = 0; i < xlen; i++) {
- for (j = 0; j < ylen; j++) {
- free(input[i][j]);
- }
- free(input[i]);
- }
- free(input);
-}
-
-void nr_free_uint8_2D_array(uint8_t **input, uint16_t xlen) {
- for (int i = 0; i < xlen; i++) free(input[i]);
- free(input);
-}
-
// Modified Bubble Sort.
void nr_sort_asc_double_1D_array_ind(double *matrix, uint8_t *ind, uint8_t len) {
int swaps;
diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c
index f6a700117d..38a1ae86ae 100644
--- a/openair1/PHY/CODING/nr_polar_init.c
+++ b/openair1/PHY/CODING/nr_polar_init.c
@@ -33,178 +33,236 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
#include "PHY/NR_TRANSPORT/nr_dci.h"
+#define PolarKey ((messageType<<24)|(messageLength<<8)|aggregation_level)
+static t_nrPolar_params * PolarList=NULL;
+pthread_mutex_t PolarListMutex=PTHREAD_MUTEX_INITIALIZER;
+
static int intcmp(const void *p1,const void *p2) {
return(*(int16_t *)p1 > *(int16_t *)p2);
}
-static void nr_polar_init(t_nrPolar_params * *polarParams,
- int8_t messageType,
+static void nr_polar_delete_list(t_nrPolar_params * polarParams) {
+ if (!polarParams)
+ return;
+ if (polarParams->nextPtr)
+ nr_polar_delete_list(polarParams->nextPtr);
+
+ delete_decoder_tree(polarParams);
+ //From build_polar_tables()
+ for (int k=0; k < polarParams->K + polarParams->n_pc; k++)
+ if (polarParams->G_N_tab[k])
+ free(polarParams->G_N_tab[k]);
+ free(polarParams->G_N_tab);
+ free(polarParams->rm_tab);
+ if (polarParams->crc_generator_matrix)
+ free(polarParams->crc_generator_matrix);
+ //polar_encoder vectors:
+ free(polarParams->nr_polar_crc);
+ free(polarParams->nr_polar_aPrime);
+ free(polarParams->nr_polar_APrime);
+ free(polarParams->nr_polar_D);
+ free(polarParams->nr_polar_E);
+ //Polar Coding vectors
+ free(polarParams->nr_polar_U);
+ free(polarParams->nr_polar_CPrime);
+ free(polarParams->nr_polar_B);
+ free(polarParams->nr_polar_A);
+ free(polarParams->interleaving_pattern);
+ free(polarParams->deinterleaving_pattern);
+ free(polarParams->rate_matching_pattern);
+ free(polarParams->information_bit_pattern);
+ free(polarParams->Q_I_N);
+ free(polarParams->Q_F_N);
+ free(polarParams->Q_PC_N);
+ free(polarParams->channel_interleaver_pattern);
+ free(polarParams);
+}
+
+static void nr_polar_delete(void) {
+ pthread_mutex_lock(&PolarListMutex);
+ nr_polar_delete_list(PolarList);
+ PolarList=NULL;
+ pthread_mutex_unlock(&PolarListMutex);
+}
+
+t_nrPolar_params * nr_polar_params(int8_t messageType,
uint16_t messageLength,
uint8_t aggregation_level,
int decoder_flag) {
- t_nrPolar_params *currentPtr = *polarParams;
- uint16_t aggregation_prime = (messageType >= 2) ? aggregation_level : nr_polar_aggregation_prime(aggregation_level);
-
+ // The lock is weak, because we never delete in the list, only at exit time
+ // therefore, returning t_nrPolar_params * from the list is safe for future usage
+ pthread_mutex_lock(&PolarListMutex);
+ if(!PolarList)
+ atexit(nr_polar_delete);
+
+ t_nrPolar_params *currentPtr = PolarList;
//Parse the list. If the node is already created, return without initialization.
while (currentPtr != NULL) {
//printf("currentPtr->idx %d, (%d,%d)\n",currentPtr->idx,currentPtr->payloadBits,currentPtr->encoderLength);
//LOG_D(PHY,"Looking for index %d\n",(messageType * messageLength * aggregation_prime));
- if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return;
- else currentPtr = currentPtr->nextPtr;
+ if (currentPtr->busy == false && currentPtr->idx == PolarKey ) {
+ currentPtr->busy=true;
+ pthread_mutex_unlock(&PolarListMutex);
+ if (decoder_flag && !currentPtr->tree.root)
+ build_decoder_tree(currentPtr);
+ return currentPtr ;
+ }
+ else
+ currentPtr = currentPtr->nextPtr;
}
// printf("currentPtr %p (polarParams %p)\n",currentPtr,polarParams);
//Else, initialize and add node to the end of the linked list.
t_nrPolar_params *newPolarInitNode = calloc(sizeof(t_nrPolar_params),1);
-
- if (newPolarInitNode != NULL) {
- // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime);
- newPolarInitNode->idx = (messageType * messageLength * aggregation_prime);
- newPolarInitNode->nextPtr = NULL;
- //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level);
+ newPolarInitNode->busy=true;
+ pthread_mutex_unlock(&PolarListMutex);
- if (messageType == 0) { //PBCH
- newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX;
- newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL;
- newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG;
- newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC;
- newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM;
- newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL;
- newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS;
- newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS;
- newPolarInitNode->encoderLength = NR_POLAR_PBCH_E;
- newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS;
- newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P
- //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength);
- } else if (messageType == 1) { //DCI
- newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX;
- newPolarInitNode->i_il = NR_POLAR_DCI_I_IL;
- newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG;
- newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC;
- newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM;
- newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL;
- newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS;
- newPolarInitNode->payloadBits = messageLength;
- newPolarInitNode->encoderLength = aggregation_level*108;
- newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS;
- newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
- //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level);
- } else if (messageType == 2) { //UCI PUCCH2
- AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level);
- AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength);
- newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX;
- newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL;
- newPolarInitNode->encoderLength = aggregation_level * 16;
+ AssertFatal(newPolarInitNode != NULL, "[nr_polar_init] New t_nrPolar_params * could not be created");
+
+ // LOG_D(PHY,"Setting new polarParams index %d, messageType %d, messageLength %d, aggregation_prime %d\n",(messageType * messageLength * aggregation_prime),messageType,messageLength,aggregation_prime);
+ newPolarInitNode->idx = PolarKey;
+ newPolarInitNode->nextPtr = NULL;
+ //printf("newPolarInitNode->idx %d, (%d,%d,%d:%d)\n",newPolarInitNode->idx,messageType,messageLength,aggregation_prime,aggregation_level);
+
+ if (messageType == 0) { //PBCH
+ newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX;
+ newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL;
+ newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG;
+ newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC;
+ newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM;
+ newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL;
+ newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS;
+ newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS;
+ newPolarInitNode->encoderLength = NR_POLAR_PBCH_E;
+ newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS;
+ newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P
+ //printf("Initializing polar parameters for PBCH (K %d, E %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength);
+ } else if (messageType == 1) { //DCI
+ newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX;
+ newPolarInitNode->i_il = NR_POLAR_DCI_I_IL;
+ newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG;
+ newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC;
+ newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM;
+ newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL;
+ newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS;
+ newPolarInitNode->payloadBits = messageLength;
+ newPolarInitNode->encoderLength = aggregation_level*108;
+ newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS;
+ newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
+ //printf("Initializing polar parameters for DCI (K %d, E %d, L %d)\n",newPolarInitNode->payloadBits,newPolarInitNode->encoderLength,aggregation_level);
+ } else if (messageType == 2) { //UCI PUCCH2
+ AssertFatal(aggregation_level>2,"Aggregation level (%d) for PUCCH 2 encoding is NPRB and should be > 2\n",aggregation_level);
+ AssertFatal(messageLength>11,"Message length %d is too short for polar encoding of UCI\n",messageLength);
+ newPolarInitNode->n_max = NR_POLAR_PUCCH_N_MAX;
+ newPolarInitNode->i_il = NR_POLAR_PUCCH_I_IL;
+ newPolarInitNode->encoderLength = aggregation_level * 16;
- newPolarInitNode->i_seg = 0;
+ newPolarInitNode->i_seg = 0;
- if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)||
- (messageLength >= 1013)) newPolarInitNode->i_seg = 1;
+ if ((messageLength >= 360 && newPolarInitNode->encoderLength >= 1088)||
+ (messageLength >= 1013)) newPolarInitNode->i_seg = 1;
- newPolarInitNode->crcParityBits = 11;
- newPolarInitNode->n_pc = 0;
- newPolarInitNode->n_pc_wm = 0;
+ newPolarInitNode->crcParityBits = 11;
+ newPolarInitNode->n_pc = 0;
+ newPolarInitNode->n_pc_wm = 0;
- if (messageLength < 20) {
- newPolarInitNode->crcParityBits = 6;
- newPolarInitNode->n_pc = 3;
- if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1;
- }
-
-
-
- newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL;
-
- newPolarInitNode->payloadBits = messageLength;
- newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS;
- //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
- //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level);
- } else {
- AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType);
+ if (messageLength < 20) {
+ newPolarInitNode->crcParityBits = 6;
+ newPolarInitNode->n_pc = 3;
+ if ((newPolarInitNode->encoderLength - messageLength - 6 + 3) < 193) newPolarInitNode->n_pc_wm = 1;
}
- newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode.
- newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K,
- newPolarInitNode->encoderLength,
- newPolarInitNode->n_max);
- newPolarInitNode->n = log2(newPolarInitNode->N);
- newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n);
- //polar_encoder vectors:
- newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits);
- newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3));
- newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K);
- newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N);
- newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength);
- //Polar Coding vectors
- newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat
- newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat
- newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat
- newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat
- newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n);
- newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K);
- nr_polar_interleaving_pattern(newPolarInitNode->K,
- newPolarInitNode->i_il,
- newPolarInitNode->interleaving_pattern);
- newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K);
- for (int i=0; iK; i++)
- newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i;
- newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
- uint16_t *J = malloc(sizeof(uint16_t) * newPolarInitNode->N);
- nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern,
- J,
- nr_polar_subblock_interleaver_pattern,
- newPolarInitNode->K,
- newPolarInitNode->N,
- newPolarInitNode->encoderLength);
- newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N);
- newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc));
- newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value.
- newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc));
+ newPolarInitNode->i_bil = NR_POLAR_PUCCH_I_BIL;
- for (int i = 0; i <= newPolarInitNode->N; i++)
- newPolarInitNode->Q_F_N[i] = -1; // Empty array.
-
- nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern,
- newPolarInitNode->Q_I_N,
- newPolarInitNode->Q_F_N,
- J,
- newPolarInitNode->Q_0_Nminus1,
- newPolarInitNode->K,
- newPolarInitNode->N,
- newPolarInitNode->encoderLength,
- newPolarInitNode->n_pc);
- // sort the Q_I_N array in ascending order (first K positions)
- qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp);
- newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
- nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern,
- newPolarInitNode->i_bil,
- newPolarInitNode->encoderLength);
- free(J);
- if (decoder_flag == 1) build_decoder_tree(newPolarInitNode);
- build_polar_tables(newPolarInitNode);
- init_polar_deinterleaver_table(newPolarInitNode);
- //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes);
+ newPolarInitNode->payloadBits = messageLength;
+ newPolarInitNode->crcCorrectionBits = NR_POLAR_PUCCH_CRC_ERROR_CORRECTION_BITS;
+ //newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
+ //LOG_D(PHY,"New polar node, encoderLength %d, aggregation_level %d\n",newPolarInitNode->encoderLength,aggregation_level);
} else {
- AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_params * could not be created");
+ AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType);
}
- //Fixme: the list is not thread safe
- //The defect is not critical: we always append (never delete items) and adding two times the same is fine
- newPolarInitNode->nextPtr=*polarParams;
- *polarParams=newPolarInitNode;
- return;
+ newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode.
+ newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K,
+ newPolarInitNode->encoderLength,
+ newPolarInitNode->n_max);
+ newPolarInitNode->n = log2(newPolarInitNode->N);
+ newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n);
+ //polar_encoder vectors:
+ newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits);
+ newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3));
+ newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K);
+ newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N);
+ newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength);
+ //Polar Coding vectors
+ newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat
+ newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat
+ newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat
+ newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat
+ newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n);
+ newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K);
+ nr_polar_interleaving_pattern(newPolarInitNode->K,
+ newPolarInitNode->i_il,
+ newPolarInitNode->interleaving_pattern);
+ newPolarInitNode->deinterleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K);
+
+ for (int i=0; iK; i++)
+ newPolarInitNode->deinterleaving_pattern[newPolarInitNode->interleaving_pattern[i]] = i;
+
+ newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
+ uint16_t J[newPolarInitNode->N];
+ nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern,
+ J,
+ nr_polar_subblock_interleaver_pattern,
+ newPolarInitNode->K,
+ newPolarInitNode->N,
+ newPolarInitNode->encoderLength);
+ newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N);
+ newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc));
+ newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value.
+ newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc));
+
+ for (int i = 0; i <= newPolarInitNode->N; i++)
+ newPolarInitNode->Q_F_N[i] = -1; // Empty array.
+
+ nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern,
+ newPolarInitNode->Q_I_N,
+ newPolarInitNode->Q_F_N,
+ J,
+ newPolarInitNode->Q_0_Nminus1,
+ newPolarInitNode->K,
+ newPolarInitNode->N,
+ newPolarInitNode->encoderLength,
+ newPolarInitNode->n_pc);
+ // sort the Q_I_N array in ascending order (first K positions)
+ qsort((void *)newPolarInitNode->Q_I_N,newPolarInitNode->K,sizeof(int16_t),intcmp);
+ newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
+ nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern,
+ newPolarInitNode->i_bil,
+ newPolarInitNode->encoderLength);
+ if (decoder_flag == 1)
+ build_decoder_tree(newPolarInitNode);
+ build_polar_tables(newPolarInitNode);
+ init_polar_deinterleaver_table(newPolarInitNode);
+ //printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes);
+
+ newPolarInitNode->nextPtr=PolarList;
+ PolarList=newPolarInitNode;
+ return newPolarInitNode;
}
-void nr_polar_print_polarParams(t_nrPolar_params *polarParams) {
+void nr_polar_print_polarParams() {
uint8_t i = 0;
- if (polarParams == NULL) {
+ if (PolarList == NULL) {
printf("polarParams is empty.\n");
} else {
+ t_nrPolar_params * polarParams=PolarList;
while (polarParams != NULL) {
- printf("polarParams[%d] = %d\n", i, polarParams->idx);
+ printf("polarParams[%d] = %d, %d, %d\n", i,
+ polarParams->idx>>24, (polarParams->idx>>8)&0xFFFF, polarParams->idx&0xFF);
polarParams = polarParams->nextPtr;
i++;
}
@@ -213,31 +271,6 @@ void nr_polar_print_polarParams(t_nrPolar_params *polarParams) {
return;
}
-t_nrPolar_params *nr_polar_params (int8_t messageType,
- uint16_t messageLength,
- uint8_t aggregation_level,
- int decoding_flag,
- t_nrPolar_params **polarList_ext) {
- static t_nrPolar_params *polarList = NULL;
- nr_polar_init(polarList_ext != NULL ? polarList_ext : &polarList,
- messageType,messageLength,aggregation_level,decoding_flag);
- t_nrPolar_params *polarParams=polarList_ext != NULL ? *polarList_ext : polarList;
- const int tag=messageType * messageLength * (messageType>=2 ? aggregation_level : nr_polar_aggregation_prime(aggregation_level));
-
-
-
- while (polarParams != NULL) {
- // LOG_D(PHY,"nr_polar_params : tag %d (from nr_polar_init %d)\n",tag,polarParams->idx);
- if (polarParams->idx == tag)
- return polarParams;
-
- polarParams = polarParams->nextPtr;
- }
-
- AssertFatal(false,"Polar Init tables internal failure, no polarParams found\n");
- return NULL;
-}
-
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level) {
if (aggregation_level == 0) return 0;
else if (aggregation_level == 1) return NR_POLAR_AGGREGATION_LEVEL_1_PRIME;
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 308a059d51..c92d926a8f 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -415,10 +415,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset
);
- LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id);
LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n",
eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration);
- LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id);
crcTableInit();
lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell);
generate_pcfich_reg_mapping (fp);
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index 3bf450703c..bf360d347a 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -104,7 +104,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
load_dftslib();
- LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
crcTableInit();
init_scrambling_luts();
init_pucch2_luts();
@@ -243,37 +242,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
common_vars->debugBuff = (int32_t*)malloc16_clear(fp->samples_per_frame*sizeof(int32_t)*100);
common_vars->debugBuff_sample_offset = 0;
-
- // Channel estimates for SRS
-/*
- for (UE_id=0; UE_idofdm_symbol_size );
- srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
- }
- } //UE_id
-*/
- /*generate_ul_ref_sigs_rx();
-
- init_ulsch_power_LUT();*/
-
-/*
- // SRS
- for (UE_id=0; UE_idofdm_symbol_size*sizeof(int32_t));
- }
-*/
// PRACH
prach_vars->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) );
prach_vars->rxsigF = (int16_t **)malloc16_clear(Prx*sizeof(int16_t*));
- /*
- for (i=0;irxsigF[i] = (int16_t *)malloc16_clear( 1024*2*sizeof(int16_t) );
- }
- */
prach_vars->prach_ifft = (int32_t *)malloc16_clear(1024*2*sizeof(int32_t));
init_prach_list(gNB);
@@ -329,51 +300,102 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
{
NR_DL_FRAME_PARMS* const fp = &gNB->frame_parms;
- NR_gNB_COMMON *const common_vars = &gNB->common_vars;
- NR_gNB_PUSCH **const pusch_vars = gNB->pusch_vars;
- /*LTE_eNB_SRS *const srs_vars = gNB->srs_vars;
- LTE_eNB_PRACH *const prach_vars = &gNB->prach_vars;*/
- uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
- int Ptx=gNB->gNB_config.carrier_config.num_tx_ant.value;
+ const int Ptx = gNB->gNB_config.carrier_config.num_tx_ant.value;
+ const int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value;
+ const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB()
+ const int n_buf = Prx * max_ul_mimo_layers;
+ uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++)
+ free_and_zero(pdcch_dmrs[slot][symb]);
+ free_and_zero(pdcch_dmrs[slot]);
+ }
+ free_and_zero(pdcch_dmrs);
+
+ uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
+ for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
+ free_and_zero(pdsch_dmrs[slot][symb][q]);
+ free_and_zero(pdsch_dmrs[slot][symb]);
+ }
+ free_and_zero(pdsch_dmrs[slot]);
+ }
+ free_and_zero(gNB->nr_gold_pdsch_dmrs);
+
+ uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs;
+ for(int nscid = 0; nscid < 2; nscid++) {
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++)
+ free_and_zero(pusch_dmrs[nscid][slot][symb]);
+ free_and_zero(pusch_dmrs[nscid][slot]);
+ }
+ free_and_zero(pusch_dmrs[nscid]);
+ }
+ free_and_zero(pusch_dmrs);
+
+ uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++)
+ free_and_zero(csi_rs[slot][symb]);
+ free_and_zero(csi_rs[slot]);
+ }
+ free_and_zero(csi_rs);
+
+ for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
+ for (int i = 0; i < Prx; i++){
+ free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]);
+ free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]);
+ }
+ free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal);
+ free_and_zero(gNB->nr_srs_info[id]->noise_power);
+ free_and_zero(gNB->nr_srs_info[id]->srs_received_signal);
+ free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time);
+ free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted);
+ free_and_zero(gNB->nr_srs_info[id]);
+ }
+
+ free_ul_reference_signal_sequences();
+ free_gnb_lowpapr_sequences();
+
+ reset_nr_transport(gNB);
+
+ NR_gNB_COMMON * common_vars = &gNB->common_vars;
for (int i = 0; i < Ptx; i++) {
free_and_zero(common_vars->txdataF[i]);
- /* rxdataF[i] is not allocated -> don't free */
+ free_and_zero(common_vars->beam_id[i]);
+ }
+
+ for (int i = 0; i < Prx; ++i) {
+ free_and_zero(common_vars->rxdataF[i]);
+ free_and_zero(common_vars->rxdata[i]);
}
free_and_zero(common_vars->txdataF);
+ free_and_zero(common_vars->rxdata);
free_and_zero(common_vars->rxdataF);
- // PDCCH DMRS sequences
- free_and_zero(pdcch_dmrs);
-/*
- // Channel estimates for SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
- for (i=0; i<64; i++) {
- free_and_zero(srs_vars[UE_id].srs_ch_estimates[i]);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time[i]);
- }
+ free_and_zero(common_vars->beam_id);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time);
- } //UE_id
-
- //free_ul_ref_sigs();
-
- for (UE_id=0; UE_iddebugBuff);
+ NR_gNB_PRACH* prach_vars = &gNB->prach_vars;
free_and_zero(prach_vars->prachF);
+ free_and_zero(prach_vars->rxsigF);
+ free_and_zero(prach_vars->prach_ifft);
- for (i = 0; i < 64; i++) free_and_zero(prach_vars->prach_ifft[0][i]);
-
- free_and_zero(prach_vars->prach_ifft[0]);
- free_and_zero(prach_vars->rxsigF[0]);
-*/
+ NR_gNB_PUSCH** pusch_vars = gNB->pusch_vars;
for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) {
- for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ for (int i = 0; i < Prx; i++) {
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
}
- for (int i = 0; i < 4*fp->nb_antennas_rx; i++) {
+ for (int i = 0; i < n_buf; i++) {
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i]);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time[i]);
@@ -393,8 +415,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext);
- free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time);
free_and_zero(pusch_vars[ULSCH_id]->ptrs_phase_per_slot);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_time);
free_and_zero(pusch_vars[ULSCH_id]->ul_valid_re_per_slot);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag0);
@@ -406,14 +428,6 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pusch_vars[ULSCH_id]->llr);
free_and_zero(pusch_vars[ULSCH_id]);
} //ULSCH_id
-/*
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) gNB->UE_stats_ptr[UE_id] = NULL;
-*/
-
-
- free_gnb_lowpapr_sequences();
-
-
}
//Adding nr_schedule_handler
@@ -554,6 +568,16 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
}
}
+void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
+{
+ const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
+ const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
+ const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
+ for (int i=0; inumber_of_nr_dlsch_max; i++)
+ for (int j=0; j<2; j++)
+ free_gNB_dlsch(&msg->dlsch[i][j], grid_size);
+}
+
void init_nr_transport(PHY_VARS_gNB *gNB) {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
LOG_I(PHY, "Initialise nr transport\n");
@@ -578,7 +602,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
for (int j=0; j<2; j++) {
// ULSCH for data
- gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0);
+ gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
if (!gNB->ulsch[i][j]) {
LOG_E(PHY,"Can't get gNB ulsch structures\n");
@@ -594,3 +618,18 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
//fp->pucch_config_common.deltaPUCCH_Shift = 1;
}
+
+void reset_nr_transport(PHY_VARS_gNB *gNB)
+{
+ const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
+
+ for (int i = 0; i < NUMBER_OF_NR_PUCCH_MAX; i++)
+ free_gNB_pucch(gNB->pucch[i]);
+
+ for (int i = 0; i < NUMBER_OF_NR_SRS_MAX; i++)
+ free_gNB_srs(gNB->srs[i]);
+
+ for (int i=0; inumber_of_nr_ulsch_max; i++)
+ for (int j=0; j<2; j++)
+ free_gNB_ulsch(&gNB->ulsch[i][j], fp->N_RB_UL);
+}
diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index 4024ed1617..07f1d3b9e3 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -124,32 +124,32 @@ int nr_phy_init_RU(RU_t *ru) {
ru->num_gNB,NUMBER_OF_gNB_MAX);
LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
-
- if (ru->do_precoding == 1) {
+ if (ru->do_precoding == 1) {
int beam_count = 0;
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
+
for (p=0;pnb_log_antennas;p++) {
//if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
beam_count++;
}
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
- for (i=0; inum_gNB; i++) {
- int l_ind = 0;
- for (p=0;pnb_log_antennas;p++) {
+ for (i=0; inum_gNB; i++) {
+ int l_ind = 0;
+ for (p=0;pnb_log_antennas;p++) {
//if ((fp->L_ssb >> (63-p)) & 0x01) {
- ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
- for (j=0; jnb_tx; j++) {
- ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
- AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i);
- for (re=0; reofdm_symbol_size; re++)
- ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
- //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
- l_ind++;
- } // for j
+ ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
+ for (j=0; jnb_tx; j++) {
+ ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
+ AssertFatal(ru->bw_list[i],"ru->bw_list[%d] is null\n",i);
+ for (re=0; reofdm_symbol_size; re++)
+ ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
+ //printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
+ l_ind++;
+ } // for j
//}
- } // for p
- } //for i
+ } // for p
+ } //for i
}
ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*));
@@ -174,17 +174,13 @@ void nr_phy_free_RU(RU_t *ru)
LOG_I(PHY, "Feeing RU signal buffers (if_south %s) nb_tx %d\n", ru_if_types[ru->if_south], ru->nb_tx);
- free_and_zero(ru->nr_frame_parms);
- free_and_zero(ru->frame_parms);
-
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
- int32_t *ptr;
- for (i = 0; i < ru->nb_tx; i++) {
- ptr=&ru->common.txdata[i][-ru->sf_extension];
- free_and_zero(ptr);
- }
- for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]);
+ for (i = 0; i < ru->nb_tx; i++)
+ free_and_zero(ru->common.txdata[i]);
free_and_zero(ru->common.txdata);
+
+ for (i = 0; i < ru->nb_rx; i++)
+ free_and_zero(ru->common.rxdata[i]);
free_and_zero(ru->common.rxdata);
} // else: IF5 or local RF -> nothing to free()
@@ -193,7 +189,7 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->common.rxdata_7_5kHz);
// free beamforming input buffers (TX)
- for (i = 0; i < 15; i++) free_and_zero(ru->common.txdataF[i]);
+ for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF[i]);
free_and_zero(ru->common.txdataF);
// free IFFT input buffers (TX)
@@ -205,15 +201,21 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->common.rxdataF);
for (j=0;jnb_rx; i++) {
+ for (i = 0; i < ru->nb_rx; i++)
free_and_zero(ru->prach_rxsigF[j][i]);
- }
+ free_and_zero(ru->prach_rxsigF[j]);
}
- for (i = 0; i < ru->num_gNB; i++) {
- for (p = 0; p < 15; p++) {
- for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
- free_and_zero(ru->beam_weights[i][p]);
+
+ if (ru->do_precoding == 1) {
+ for (i = 0; i < ru->num_gNB; i++) {
+ for (p = 0; p < ru->nb_log_antennas; p++) {
+ for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
+ free_and_zero(ru->beam_weights[i][p]);
+ }
}
+ for(i=0; i< ru->nb_tx; ++i)
+ free_and_zero(ru->common.beam_id[i]);
+ free_and_zero(ru->common.beam_id);
}
}
free_and_zero(ru->common.sync_corr);
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index b571afe416..a27c541c80 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -111,6 +111,49 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
}
}
+void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp)
+{
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ for (int j = 0; j < NR_MAX_NB_LAYERS; j++) {
+ const int idx = j * fp->nb_antennas_rx + i;
+ for (int k = 0; k < NR_MAX_NB_LAYERS; k++)
+ free_and_zero(pdsch->rho[i][j*NR_MAX_NB_LAYERS+k]);
+ free_and_zero(pdsch->rxdataF_comp0[idx]);
+ free_and_zero(pdsch->dl_ch_estimates[idx]);
+ free_and_zero(pdsch->dl_ch_estimates_ext[idx]);
+ free_and_zero(pdsch->dl_bf_ch_estimates[idx]);
+ free_and_zero(pdsch->dl_bf_ch_estimates_ext[idx]);
+ free_and_zero(pdsch->dl_ch_mag0[idx]);
+ free_and_zero(pdsch->dl_ch_magb0[idx]);
+ free_and_zero(pdsch->dl_ch_magr0[idx]);
+ }
+ free_and_zero(pdsch->rxdataF_ext[i]);
+ free_and_zero(pdsch->rxdataF_uespec_pilots[i]);
+ free_and_zero(pdsch->ptrs_phase_per_slot[i]);
+ free_and_zero(pdsch->ptrs_re_per_slot[i]);
+ free_and_zero(pdsch->dl_ch_ptrs_estimates_ext[i]);
+ free_and_zero(pdsch->rho[i]);
+ }
+ free_and_zero(pdsch->pmi_ext);
+ free_and_zero(pdsch->llr[0]);
+ free_and_zero(pdsch->layer_llr[0]);
+ free_and_zero(pdsch->llr128);
+ free_and_zero(pdsch->rxdataF_ext);
+ free_and_zero(pdsch->rxdataF_uespec_pilots);
+ free_and_zero(pdsch->rxdataF_comp0);
+ free_and_zero(pdsch->rho);
+ free_and_zero(pdsch->dl_ch_estimates);
+ free_and_zero(pdsch->dl_ch_estimates_ext);
+ free_and_zero(pdsch->dl_bf_ch_estimates);
+ free_and_zero(pdsch->dl_bf_ch_estimates_ext);
+ free_and_zero(pdsch->dl_ch_mag0);
+ free_and_zero(pdsch->dl_ch_magb0);
+ free_and_zero(pdsch->dl_ch_magr0);
+ free_and_zero(pdsch->ptrs_phase_per_slot);
+ free_and_zero(pdsch->ptrs_re_per_slot);
+ free_and_zero(pdsch->dl_ch_ptrs_estimates_ext);
+}
+
void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
const NR_DL_FRAME_PARMS *const fp) {
AssertFatal( pusch, "pusch==0" );
@@ -120,9 +163,14 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
}
}
-int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
- int nb_connected_gNB,
- uint8_t abstraction_flag) {
+void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch)
+{
+ for (int i = 0; i < NR_MAX_NB_LAYERS; i++)
+ free_and_zero(pusch->txdataF_layers[i]);
+}
+
+int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
+{
// create shortcuts
NR_DL_FRAME_PARMS *const fp = &ue->frame_parms;
NR_UE_COMMON *const common_vars = &ue->common_vars;
@@ -134,11 +182,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
int gNB_id;
int th_id;
uint32_t ****pusch_dmrs;
- uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig
- int n_scid;
- abstraction_flag = 0;
- LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx);
- //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST);
+ LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
phy_init_nr_top(ue);
// many memory allocation sizes are hard coded
AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" );
@@ -192,7 +236,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
///////////
ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
pusch_dmrs = ue->nr_gold_pusch_dmrs;
- n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
for (slot=0; slotslots_per_frame; slot++) {
pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
@@ -209,7 +252,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
}
- nr_init_pusch_dmrs(ue, N_n_scid, n_scid);
///////////
////////////////////////////////////////////////////////////////////////////////////////////
@@ -231,29 +273,27 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
for (i=0; i<10; i++)
ue->tx_power_dBm[i]=-127;
- if (abstraction_flag == 0) {
- // init TX buffers
- common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
- common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
+ // init TX buffers
+ common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
+ common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
- for (i=0; inb_antennas_tx; i++) {
- common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) );
- common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) );
- }
+ for (i=0; inb_antennas_tx; i++) {
+ common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) );
+ common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) );
+ }
- // init RX buffers
- common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
+ // init RX buffers
+ common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
+
+ for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
+ }
+
+ for (i=0; inb_antennas_rx; i++) {
+ common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
- }
-
- for (i=0; inb_antennas_rx; i++) {
- common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
-
- for (th_id=0; th_idcommon_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) );
- }
+ common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) );
}
}
@@ -272,9 +312,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
}
- ue->scramblingID_pdcch = fp->Nid_cell;
- nr_gold_pdcch(ue,fp->Nid_cell);
-
//PDSCH DMRS init (eNB offset = 0)
ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0];
@@ -294,12 +331,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
}
- // initializing the scrambling IDs for PDSCH DMRS
- for (int i=0; i<2; i++)
- ue->scramblingID[i]=fp->Nid_cell;
-
- nr_gold_pdsch(ue,ue->scramblingID);
-
// DLSCH
for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
for (th_id=0; th_idnr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
- if (abstraction_flag == 0) {
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp );
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp );
+ }
+
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
+ ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
+ ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
+ ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
+ ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
+ }
+
+
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ }
+
+ for (i=0; inb_antennas_rx; i++)
+ for (j=0; j<4; j++) {
+ const int idx = (j*fp->nb_antennas_rx)+i;
+ const size_t num = 7*2*fp->N_RB_DL*12+4;
+
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
+ }
}
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
- ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
- ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
- ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
- ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
- }
-
-
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- }
-
- for (i=0; inb_antennas_rx; i++)
- for (j=0; j<4; j++) {
- const int idx = (j*fp->nb_antennas_rx)+i;
- const size_t num = 7*2*fp->N_RB_DL*12+4;
-
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
- }
+ //const size_t num = 7*2*fp->N_RB_DL*12+4;
+ for (k=0; k<8; k++) { //harq_pid
+ for (l=0; l<8; l++) { //round
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
}
- //const size_t num = 7*2*fp->N_RB_DL*12+4;
- for (k=0; k<8; k++) { //harq_pid
- for (l=0; l<8; l++) { //round
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- }
+ for (int i=0; inb_antennas_rx; i++)
+ for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
+ const int idx = (j*fp->nb_antennas_rx)+i;
- for (int i=0; inb_antennas_rx; i++)
- for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
- const int idx = (j*fp->nb_antennas_rx)+i;
-
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
- ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
- ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
- ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
- }
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
+ ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
+ ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
+ ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
}
- }
- }
-
- // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
- for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
- ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
- ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
- ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 );
- ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- // Channel estimates
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
-
- for (i=0; inb_antennas_rx; i++) {
- ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4));
-
- for (j=0; j<4; j++) {
- int idx = (j*fp->nb_antennas_rx)+i;
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
- // size_t num = 7*2*fp->N_RB_DL*12;
- size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
- ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
- ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
- ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
}
- }
}
+ }
- // PBCH
- pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
- pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
- prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
- prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
+ // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
+ for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
+ ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
+ ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
+ ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 );
+ ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ // Channel estimates
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
for (i=0; inb_antennas_rx; i++) {
- pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
+ ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4));
- for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
+ for (j=0; j<4; j++) {
int idx = (j*fp->nb_antennas_rx)+i;
- pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
- pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
- pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
- pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
+ // size_t num = 7*2*fp->N_RB_DL*12;
+ size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
+ ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
+ ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
+ ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
}
}
}
+ // PBCH
+ pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
+ pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
+ pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
+ prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
+ prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
+
+ for (i=0; inb_antennas_rx; i++) {
+ pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
+
+ for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
+ int idx = (j*fp->nb_antennas_rx)+i;
+ pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
+ pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
+ pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
+ pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
+ }
+ }
+
pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64);
}
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH));
- }
-
- if (abstraction_flag == 0) {
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp );
- ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
- ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
- }
- } else { //abstraction == 1
- ue->sinr_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
+ ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH));
+ ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
+ ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
}
ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
@@ -474,25 +495,224 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
return 0;
}
-void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
- int abstraction_flag) {
+void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
+{
+ const NR_DL_FRAME_PARMS* fp = &ue->frame_parms;
+ phy_term_nr_top();
+
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
+ for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
+ phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]);
+ free_and_zero(ue->pusch_vars[th_id][gNB_id]);
+ free_and_zero(ue->pucch_vars[th_id][gNB_id]);
+ }
+ }
+
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
+ for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
+ free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]);
+ free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]);
+ }
+ free_and_zero(ue->nr_gold_pusch_dmrs[slot]);
+ }
+ free_and_zero(ue->nr_gold_pusch_dmrs);
+
+ NR_UE_COMMON* common_vars = &ue->common_vars;
+
+ for (int i = 0; i < fp->nb_antennas_tx; i++) {
+ free_and_zero(common_vars->txdata[i]);
+ free_and_zero(common_vars->txdataF[i]);
+ }
+
+ free_and_zero(common_vars->txdata);
+ free_and_zero(common_vars->txdataF);
+
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ free_and_zero(common_vars->rxdata[i]);
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++)
+ free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i]);
+ }
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
+ free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF);
+ }
+ free_and_zero(common_vars->rxdata);
+
+ for (int slot = 0; slot < fp->slots_per_frame; slot++) {
+ for (int symb = 0; symb < fp->symbols_per_slot; symb++)
+ free_and_zero(ue->nr_gold_pdcch[0][slot][symb]);
+ free_and_zero(ue->nr_gold_pdcch[0][slot]);
+ }
+ free_and_zero(ue->nr_gold_pdcch[0]);
+
+ for (int slot=0; slotslots_per_frame; slot++) {
+ for (int symb=0; symbsymbols_per_slot; symb++) {
+ for (int q=0; qnr_gold_pdsch[0][slot][symb][q]);
+ free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
+ }
+ free_and_zero(ue->nr_gold_pdsch[0][slot]);
+ }
+ free_and_zero(ue->nr_gold_pdsch[0]);
+
+ for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
+
+ // PDSCH
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
+ for (int k = 0; k < 8; k++) { //harq_pid
+ for (int l = 0; l < 8; l++) { //round
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++)
+ const int idx = j * fp->nb_antennas_rx + i;
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]);
+ }
+ }
+
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]);
+ }
+ }
+
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ for (int j = 0; j < 4; j++) {
+ const int idx = (j*fp->nb_antennas_rx)+i;
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]);
+ }
+ }
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext);
+
+ phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
+ }
+
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ for (int j = 0; j < 4; j++) {
+ int idx = j * fp->nb_antennas_rx + i;
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]);
+ }
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho[i]);
+ }
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates);
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time);
+
+ free_and_zero(ue->pdcch_vars[th_id][gNB_id]);
+ }
+
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ free_and_zero(ue->nr_srs_info->srs_received_signal[i]);
+ free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq[i]);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]);
+ }
+ free_and_zero(ue->nr_srs_info->srs_generated_signal);
+ free_and_zero(ue->nr_srs_info->noise_power);
+ free_and_zero(ue->nr_srs_info->srs_received_signal);
+ free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_time);
+ free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted);
+ free_and_zero(ue->nr_srs_info);
+
+ free_and_zero(ue->srs_vars[gNB_id]);
+
+ for (int i = 0; i < fp->nb_antennas_rx; i++) {
+ free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]);
+
+ for (int j = 0; j < 4; j++) {
+ int idx = (j*fp->nb_antennas_rx)+i;
+ free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]);
+ }
+ }
+
+ free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext);
+ free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext);
+ free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time);
+ free_and_zero(ue->pbch_vars[gNB_id]->llr);
+ free_and_zero(ue->pbch_vars[gNB_id]->decoded_output);
+ free_and_zero(ue->pbch_vars[gNB_id]);
+
+ free_and_zero(ue->prach_vars[gNB_id]->prachF);
+ free_and_zero(ue->prach_vars[gNB_id]->prach);
+ free_and_zero(ue->prach_vars[gNB_id]);
+ }
+
+ const int gNB_id = ue->n_connected_gNB;
+ for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
+ free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
+ }
+
+ free_and_zero(ue->sinr_CQI_dB);
+}
+
+void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
+{
+ const int N_RB_DL = ue->frame_parms.N_RB_DL;
+ for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
+ for (int j = 0; j < 2; j++) {
+ for (int k = 0; k < RX_NB_TH_MAX; k++) {
+ free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL);
+ free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL);
+ }
+ }
+
+ free_nr_ue_dlsch(&ue->dlsch_SI[i], N_RB_DL);
+ free_nr_ue_dlsch(&ue->dlsch_ra[i], N_RB_DL);
+ }
+
+ free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL);
+}
+
+void init_nr_ue_transport(PHY_VARS_NR_UE *ue)
+{
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
for (int j=0; j<2; j++) {
for (int k=0; kdlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n");
+ AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n");
LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
- AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES, abstraction_flag))!=NULL,"Can't get ue ulsch structures\n");
+ AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n");
LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]);
}
}
- ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag);
- ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag);
+ ue->dlsch_SI[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL);
+ ue->dlsch_ra[i] = new_nr_ue_dlsch(1,1,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL);
ue->transmission_mode[i] = ue->frame_parms.nb_antenna_ports_gNB==1 ? 1 : 2;
}
//ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
- ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0);
+ ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL);
for(int i=0; i<5; i++)
ue->dl_stats[i] = 0;
@@ -556,3 +776,9 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
//init_unscrambling_lut();
//set_taus_seed(1328);
}
+
+void phy_term_nr_top(void)
+{
+ free_ul_reference_signal_sequences();
+ free_context_synchro_nr();
+}
diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h
index dd9232de83..8648dd7d82 100644
--- a/openair1/PHY/INIT/phy_init.h
+++ b/openair1/PHY/INIT/phy_init.h
@@ -57,6 +57,7 @@ int l1_north_init_eNB(void);
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);
void phy_init_nr_top(PHY_VARS_NR_UE *ue);
+void phy_term_nr_top(void);
/*!
@@ -395,8 +396,9 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb);
int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
-int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
-void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
+int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB);
+void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB);
+void init_nr_ue_transport(PHY_VARS_NR_UE *ue);
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag);
@@ -405,11 +407,13 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
int l1_north_init_gNB(void);
void init_nr_transport(PHY_VARS_gNB *gNB);
+void reset_nr_transport(PHY_VARS_gNB *gNB);
void init_dfts(void);
void fill_subframe_mask(PHY_VARS_eNB *eNB);
void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg);
+void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index ae8c666d18..fceff580a3 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -601,7 +601,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
G = G - Q_RI - Q_CQI;
ulsch_harq->G = G;
AssertFatal((int)G > 0,
- "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u\n",G,Q_RI,Q_CQI);
+ "FATAL: ulsch_decoding.c G < 0 (%u) : Q_RI %u, Q_CQI %u, nb_rb %u, Q_m %u, ulsch_harq->Nsymb_pusch %u, Qprime %u\n",
+ G, Q_RI, Q_CQI, nb_rb, Q_m, ulsch_harq->Nsymb_pusch, Qprime);
H = G + Q_CQI;
Hprime = H/Q_m;
// Demultiplexing/Deinterleaving of PUSCH/ACK/RI/CQI
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
index a7054a44d2..0b665737a7 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_demodulation.c
@@ -6481,7 +6481,7 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
LOG_M(fname,vname,ue->pdsch_vars[ue->current_thread_id[subframe]][eNB_id]->rxdataF_uespec_pilots[0],
- 12*(ue->frame_parms.N_RB_DL)*NSYMB,1,1);
+ 12*(ue->frame_parms.N_RB_DL),1,1);
/*
LOG_M("dlsch%d_ch_ext01.m","dl01_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*NSYMB,1,1);
LOG_M("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*NSYMB,1,1);
diff --git a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h
index 52a9c41ae9..44f8549258 100644
--- a/openair1/PHY/NR_REFSIG/ss_pbch_nr.h
+++ b/openair1/PHY/NR_REFSIG/ss_pbch_nr.h
@@ -65,6 +65,7 @@
/* SS/PBCH parameters */
#define N_RB_SS_PBCH_BLOCK (20)
#define NB_SYMBOLS_PBCH (3)
+#define NR_N_SYMBOLS_SSB (4)
#define IQ_SIZE (sizeof(int16_t) * 2) /* I and Q are alternatively stored into buffers */
#define N_SYMB_SLOT (14)
diff --git a/openair1/PHY/NR_REFSIG/sss_nr.h b/openair1/PHY/NR_REFSIG/sss_nr.h
index 12d91ed3d1..03610ae30f 100644
--- a/openair1/PHY/NR_REFSIG/sss_nr.h
+++ b/openair1/PHY/NR_REFSIG/sss_nr.h
@@ -63,18 +63,22 @@
/************** VARIABLES *****************************************/
-#define PHASE_HYPOTHESIS_NUMBER (7)
+#define PHASE_HYPOTHESIS_NUMBER (16)
#define INDEX_NO_PHASE_DIFFERENCE (3) /* this is for no phase shift case */
EXTERN const int16_t phase_re_nr[PHASE_HYPOTHESIS_NUMBER]
#ifdef INIT_VARIABLES_SSS_NR_H
-= {16383, 25101, 30791, 32767, 30791, 25101, 16383}
+// -pi/3 ---- pi/3
+= {16384,20173,23571,26509,28932,30791,32051,32687,32687,32051,30791,
+ 28932,26509,23571,20173,16384}
#endif
;
EXTERN const int16_t phase_im_nr[PHASE_HYPOTHESIS_NUMBER]
#ifdef INIT_VARIABLES_SSS_NR_H
-= {-28378, -21063, -11208, 0, 11207, 21062, 28377};
+// -pi/3 ---- pi/3
+= {-28377,-25821,-22762,-19260,-15383,-11207,-6813,-2286,2286,6813,11207,
+ 15383,19260,22762,25821,28377}
#endif
;
@@ -92,7 +96,7 @@ int pss_ch_est_nr(PHY_VARS_NR_UE *ue,
int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR],
int32_t sss_ext[NB_ANTENNAS_RX][LENGTH_SSS_NR]);
-int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max);
+int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss);
#undef INIT_VARIABLES_SSS_NR_H
#undef EXTERN
diff --git a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c
index 4a419ae926..c3c4c7a2ee 100644
--- a/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c
+++ b/openair1/PHY/NR_REFSIG/ul_ref_seq_nr.c
@@ -122,23 +122,20 @@ int16_t *base_sequence_less_than_36(unsigned int M_ZC,
*********************************************************************/
int16_t get_index_for_dmrs_lowpapr_seq(int16_t num_dmrs_res) {
-
- int16_t index = -1;
-
- if (num_dmrs_res >= dmrs_ul_allocated_res[(MAX_INDEX_DMRS_UL_ALLOCATED_REs-1)])
+
+ int16_t index = num_dmrs_res/6 - 1;
+
+ if (index >= MAX_INDEX_DMRS_UL_ALLOCATED_REs)
index = MAX_INDEX_DMRS_UL_ALLOCATED_REs-1;
- else
- index = (num_dmrs_res/6) -1;
for (;index >= 0; index--) {
if (dmrs_ul_allocated_res[index] == num_dmrs_res)
break;
-
}
- LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index);
- return index;
+ LOG_D(PHY, "num_dmrs_res: %d INDEX RETURNED: %d", num_dmrs_res, index);
+ return index;
}
/*******************************************************************
@@ -204,6 +201,11 @@ int16_t *base_sequence_36_or_larger(unsigned int Msc_RS,
void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling)
{
+ /* prevent multiple calls, relevant when both UE & gNB initialize this */
+ static bool already_called = false;
+ if (already_called) return;
+ already_called = true;
+
unsigned int u,Msc_RS;
unsigned int v = 0; // sequence hopping and group hopping are not supported yet
@@ -223,6 +225,11 @@ void generate_lowpapr_typ1_refsig_sequences(unsigned int scaling)
void generate_ul_reference_signal_sequences(unsigned int scaling)
{
+ /* prevent multiple calls, relevant when both UE & gNB initialize this */
+ static bool already_called = false;
+ if (already_called) return;
+ already_called = true;
+
unsigned int u,v,Msc_RS;
#if 0
@@ -295,10 +302,10 @@ void free_ul_reference_signal_sequences(void)
for (u=0; u < U_GROUP_NUMBER; u++) {
for (v=0; v < V_BASE_SEQUENCE_NUMBER; v++) {
if (rv_ul_ref_sig[u][v][Msc_RS])
- free16(rv_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*ul_allocated_re[Msc_RS]);
+ free_and_zero(rv_ul_ref_sig[u][v][Msc_RS]);
if ((v==0) && (Msc_RS < MAX_INDEX_DMRS_UL_ALLOCATED_REs))
if (dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS])
- free16(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]);
+ free_and_zero(dmrs_lowpaprtype1_ul_ref_sig[u][v][Msc_RS]);
}
}
}
@@ -321,7 +328,7 @@ void free_gnb_lowpapr_sequences(void)
v=0;
for (u=0; u < U_GROUP_NUMBER; u++) {
if (gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS])
- free16(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS],2*sizeof(int16_t)*dmrs_ul_allocated_res[Msc_RS]);
+ free_and_zero(gNB_dmrs_lowpaprtype1_sequence[u][v][Msc_RS]);
}
}
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c
index d233eb9ba6..0af56ba706 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c
@@ -130,11 +130,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
uint16_t Nid = dci_pdu->ScramblingId;
uint16_t scrambling_RNTI = dci_pdu->ScramblingRNTI;
- t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE,
- dci_pdu->PayloadSizeBits,
- dci_pdu->AggregationLevel,
- 0,NULL);
- polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI,1,currentPtr);
+ polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI, 1,
+ NR_POLAR_DCI_MESSAGE_TYPE, dci_pdu->PayloadSizeBits, dci_pdu->AggregationLevel);
#ifdef DEBUG_CHANNEL_CODING
printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu->AggregationLevel);
printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n",
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index c6c89c80be..37ef5fb207 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -224,21 +224,23 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers);
#endif
- start_meas(&gNB->dlsch_resource_mapping_stats);
- for (int ap=0; apnrOfLayers; ap++) {
- // DMRS params for this ap
- get_Wt(Wt, ap, dmrs_Type);
- get_Wf(Wf, ap, dmrs_Type);
- delta = get_delta(ap, dmrs_Type);
- l_prime = 0; // single symbol ap 0
+ start_meas(&gNB->dlsch_resource_mapping_stats);
+ for (int nl=0; nlnrOfLayers; nl++) {
+
+ int dmrs_port = get_dmrs_port(nl,rel15->dmrsPorts);
+ // DMRS params for this dmrs port
+ get_Wt(Wt, dmrs_port, dmrs_Type);
+ get_Wf(Wf, dmrs_port, dmrs_Type);
+ delta = get_delta(dmrs_port, dmrs_Type);
+ l_prime = 0; // single symbol nl 0
l0 = get_l0(rel15->dlDmrsSymbPos);
l_overline = l0;
#ifdef DEBUG_DLSCH_MAPPING
uint8_t dmrs_symbol = l0+l_prime;
- printf("DMRS Type %d params for ap %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n",
- 1+dmrs_Type,ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol);
+ printf("DMRS Type %d params for nl %d: Wt %d %d \t Wf %d %d \t delta %d \t l_prime %d \t l0 %d\tDMRS symbol %d\n",
+ 1+dmrs_Type,nl, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime, l0, dmrs_symbol);
#endif
uint16_t m=0, dmrs_idx=0;
@@ -307,7 +309,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
if (ptrs_symbol)
is_ptrs_re = is_ptrs_subcarrier(k,
rel15->rnti,
- ap,
+ nl,
rel15->dmrsConfigType,
rel15->PTRSFreqDensity,
rel15->rbSize,
@@ -317,12 +319,12 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
/* Map DMRS Symbol */
if ( (dmrs_symbol_map & (1 << l)) &&
(k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 ] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
- dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
+ dmrs_idx, l, k, k_prime, n, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1)],
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
#endif
dmrs_idx++;
k_prime++;
@@ -330,30 +332,30 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
n+=(k_prime)?0:1;
}
else if(is_ptrs_re){
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (beta_ptrs*amp*mod_ptrs[ptrs_idx<<1]) >> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (beta_ptrs*amp*mod_ptrs[(ptrs_idx<<1) + 1])>> 15;
#ifdef DEBUG_DLSCH_MAPPING
printf("ptrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d, mod_ptrs: %d %d\n",
- ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
- ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]);
+ ptrs_idx, l, k, k_prime, n, ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1)],
+ ((int16_t*)txdataF_precoding[nl])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1],mod_ptrs[ptrs_idx<<1],mod_ptrs[(ptrs_idx<<1)+1]);
#endif
ptrs_idx++;
}
/* Map DATA Symbol */
else if( ptrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,frame_parms->ofdm_symbol_size,rel15->numDmrsCdmGrpsNoData,dmrs_Type)) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[ap][m<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = (amp * tx_layers[nl][m<<1]) >> 15;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[nl][(m<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
- m, l, k, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1)],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
+ m, l, k, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1)],
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
#endif
m++;
}
/* mute RE */
else {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
}
if (++k >= frame_parms->ofdm_symbol_size)
k -= frame_parms->ofdm_symbol_size;
@@ -369,26 +371,26 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
// fix the alignment issues later, use 64-bit SIMD below instead of 128.
if (0/*(frame_parms->N_RB_DL&1)==0*/) {
- __m128i *txF=(__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)];
+ __m128i *txF=(__m128i*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)];
- __m128i *txl = (__m128i*)&tx_layers[ap][m<<1];
+ __m128i *txl = (__m128i*)&tx_layers[nl][m<<1];
__m128i amp128=_mm_set1_epi16(amp);
for (int i=0; i<(upper_limit>>2); i++) {
txF[i] = _mm_mulhrs_epi16(amp128,txl[i]);
} //RE loop, first part
m+=upper_limit;
if (remaining_re > 0) {
- txF = (__m128i*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)];
- txl = (__m128i*)&tx_layers[ap][m<<1];
+ txF = (__m128i*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size)<<1)];
+ txl = (__m128i*)&tx_layers[nl][m<<1];
for (int i=0; i<(remaining_re>>2); i++) {
txF[i] = _mm_mulhrs_epi16(amp128,txl[i]);
}
}
}
else {
- __m64 *txF=(__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)];
+ __m64 *txF=(__m64*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size+start_sc)<<1)];
- __m64 *txl = (__m64*)&tx_layers[ap][m<<1];
+ __m64 *txl = (__m64*)&tx_layers[nl][m<<1];
__m64 amp64=_mm_set1_pi16(amp);
for (int i=0; i<(upper_limit>>1); i++) {
@@ -396,31 +398,31 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
#ifdef DEBUG_DLSCH_MAPPING
if ((i&1) > 0)
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
- m, l, start_sc+(i>>1), txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]);
+ m, l, start_sc+(i>>1), txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1)],
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + start_sc+(i>>1))<<1) + 1]);
#endif
/* handle this, mute RE */
/*else {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
+ txdataF_precoding[anl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
}*/
} //RE loop, first part
m+=upper_limit;
if (remaining_re > 0) {
- txF = (__m64*)&txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size)<<1)];
- txl = (__m64*)&tx_layers[ap][m<<1];
+ txF = (__m64*)&txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size)<<1)];
+ txl = (__m64*)&tx_layers[nl][m<<1];
for (int i=0; i<(remaining_re>>1); i++) {
txF[i] = _mm_mulhrs_pi16(amp64,txl[i]);
#ifdef DEBUG_DLSCH_MAPPING
if ((i&1) > 0)
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
- m, l, i>>1, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ],
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]);
+ m, l, i>>1, txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) ],
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + (i>>1))<<1) + 1]);
#endif
/* handle this, mute RE */
/*else {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) ] = 0;
+ txdataF_precoding[nl][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = 0;
}*/
} //RE loop, second part
} //
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index 14de9ed767..90f6909d0b 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -55,42 +55,39 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
NR_gNB_DLSCH_t *dlsch = *dlschptr;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
- if (dlsch) {
- if (N_RB != 273) {
- a_segments = a_segments*N_RB;
- a_segments = a_segments/273 +1;
- }
-
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY,"Freeing dlsch %p\n",dlsch);
-#endif
- NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
-
- if (harq->b) {
- free16(harq->b, a_segments * 1056);
- harq->b = NULL;
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY, "Freeing harq->b (%p)\n", harq->b);
-#endif
- }
-
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY, "Freeing dlsch process %d c (%p)\n", i, harq->c);
-#endif
-
- for (r = 0; r < a_segments; r++) {
-#ifdef DEBUG_DLSCH_FREE
- LOG_D(PHY, "Freeing dlsch process %d c[%d] (%p)\n", i, r, harq->c[r]);
-#endif
-
- if (harq->c[r]) {
- free16(harq->c[r], 1056);
- harq->c[r] = NULL;
- }
- }
- free16(dlsch, sizeof(NR_gNB_DLSCH_t));
- *dlschptr = NULL;
+ if (N_RB != 273) {
+ a_segments = a_segments*N_RB;
+ a_segments = a_segments/273 +1;
}
+
+ NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
+ if (harq->b) {
+ free16(harq->b, a_segments * 1056);
+ harq->b = NULL;
+ }
+ for (r = 0; r < a_segments; r++) {
+ free(harq->c[r]);
+ harq->c[r] = NULL;
+ }
+ free(harq->pdu);
+
+ for (int aa = 0; aa < 64; aa++)
+ free(dlsch->calib_dl_ch_estimates[aa]);
+ free(dlsch->calib_dl_ch_estimates);
+
+ for (int q=0; qmod_symbs[q]);
+
+ for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) {
+ free(dlsch->txdataF_precoding[layer]);
+ free(dlsch->txdataF[layer]);
+ for (int aa = 0; aa < 64; aa++)
+ free(dlsch->ue_spec_bf_weights[layer][aa]);
+ free(dlsch->ue_spec_bf_weights[layer]);
+ }
+
+ free(dlsch);
+ *dlschptr = NULL;
}
NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_TRANSPORT/nr_pbch.c
index bf5edccb1b..fc7df46496 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_pbch.c
@@ -299,8 +299,8 @@ int nr_generate_pbch(nfapi_nr_dl_tti_ssb_pdu *ssb_pdu,
/// CRC, coding and rate matching
polar_encoder_fast (&a_reversed, (void*)pbch->pbch_e, 0, 0,
- nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,0,NULL)
- );
+ NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL);
+
#ifdef DEBUG_PBCH_ENCODING
printf("Channel coding:\n");
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index d45858bca0..b62698c748 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -106,6 +106,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
uint8_t abstraction_flag,
uint16_t N_RB);
+void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
+
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
- RB extraction (signal and channel estimates)
- channel compensation (matched filtering)
@@ -296,6 +298,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, find_type_t type);
int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type);
NR_gNB_PUCCH_t *new_gNB_pucch(void);
+void free_gNB_pucch(NR_gNB_PUCCH_t *pucch);
void nr_fill_pucch(PHY_VARS_gNB *gNB,
int frame,
@@ -308,6 +311,7 @@ int nr_find_pucch(uint16_t rnti,
PHY_VARS_gNB *gNB);
NR_gNB_SRS_t *new_gNB_srs(void);
+void free_gNB_srs(NR_gNB_SRS_t *srs);
int nr_find_srs(uint16_t rnti,
int frame,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h
index f7bb3be577..0791fd2bbc 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.h
@@ -33,9 +33,9 @@
#include "PHY/defs_gNB.h"
#include "common/utils/threadPool/thread-pool.h"
-void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL);
+void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch, uint16_t N_RB_UL);
-NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag);
+NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL);
/*! \brief Perform PUSCH decoding. TS 38.212 V15.4.0 subclause 6.2
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index 250a243af1..dc575030bc 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -54,60 +54,40 @@
//extern double cpuf;
-void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL)
+void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
{
int i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
NR_gNB_ULSCH_t *ulsch = *ulschptr;
- if (ulsch) {
- if (N_RB_UL != 273) {
- a_segments = a_segments*N_RB_UL;
- a_segments = a_segments/273 +1;
- }
-
-
- for (i=0; iharq_processes[i]) {
- if (ulsch->harq_processes[i]->b) {
- free16(ulsch->harq_processes[i]->b,a_segments*1056);
- ulsch->harq_processes[i]->b = NULL;
- }
- for (r=0; rharq_processes[i]->c[r],(8448)*sizeof(uint8_t));
- ulsch->harq_processes[i]->c[r] = NULL;
- }
- for (r=0; rharq_processes[i]->d[r]) {
- free16(ulsch->harq_processes[i]->d[r],(68*384)*sizeof(int16_t));
- ulsch->harq_processes[i]->d[r] = NULL;
- }
- }
- for (r=0; rharq_processes[i]->w[r]) {
- free16(ulsch->harq_processes[i]->w[r],(3*(6144+64))*sizeof(int16_t));
- ulsch->harq_processes[i]->w[r] = NULL;
- }
- }
- for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r]){
- nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
- ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL;
- }
- }
- free16(ulsch->harq_processes[i],sizeof(NR_UL_gNB_HARQ_t));
- ulsch->harq_processes[i] = NULL;
- }
- }
- free16(ulsch,sizeof(NR_gNB_ULSCH_t));
- *ulschptr = NULL;
+ if (N_RB_UL != 273) {
+ a_segments = a_segments*N_RB_UL;
+ a_segments = a_segments/273 +1;
}
+
+ for (i=0; iharq_processes[i]) {
+ if (ulsch->harq_processes[i]->b) {
+ free_and_zero(ulsch->harq_processes[i]->b);
+ ulsch->harq_processes[i]->b = NULL;
+ }
+ for (r=0; rharq_processes[i]->c[r]);
+ free_and_zero(ulsch->harq_processes[i]->d[r]);
+ free_and_zero(ulsch->harq_processes[i]->w[r]);
+ nrLDPC_free_mem(ulsch->harq_processes[i]->p_nrLDPC_procBuf[r]);
+ ulsch->harq_processes[i]->p_nrLDPC_procBuf[r] = NULL;
+ }
+ free_and_zero(ulsch->harq_processes[i]);
+ ulsch->harq_processes[i] = NULL;
+ }
+ }
+ free_and_zero(*ulschptr);
}
-NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint8_t abstraction_flag)
+NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
{
NR_gNB_ULSCH_t *ulsch;
@@ -129,13 +109,11 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint16_t N_RB_UL, uint
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
- if (abstraction_flag == 0) {
- for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
- ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
- ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
- ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
- }
+ for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
+ ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
+ ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
+ ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
}
}
@@ -327,8 +305,8 @@ void nr_processULSegment(void* arg) {
rv_index,
ulsch_harq->new_rx,
E,
- ulsch_harq->F,
- Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) {
+ ulsch_harq->F,
+ Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) {
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
@@ -478,7 +456,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
A = (harq_process->TBS)<<3;
- LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R);
+ LOG_D(NR_PHY, "ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n", harq_pid, A, G, mcs, n_layers, nb_rb, Qm, n_layers, R);
if (R<1024)
Coderate = (float) R /(float) 1024;
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index 56d87866ed..b85dbd1454 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -62,6 +62,11 @@ NR_gNB_PUCCH_t *new_gNB_pucch(void){
return (pucch);
}
+void free_gNB_pucch(NR_gNB_PUCCH_t *pucch)
+{
+ free_and_zero(pucch);
+}
+
int nr_find_pucch(uint16_t rnti,
int frame,
int slot,
@@ -1533,7 +1538,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
}
else { // polar coded case
- t_nrPolar_params *currentPtr = nr_polar_params(2,nb_bit,pucch_pdu->prb_size,1,&gNB->uci_polarParams);
__m64 *rp_re[Prx2][2];
__m64 *rp2_re[Prx2][2];
__m64 *rp_im[Prx2][2];
@@ -1660,7 +1664,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
} // half_prb
} // symb
// run polar decoder on llrs
- decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr);
+ decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, 2,nb_bit,pucch_pdu->prb_size);
LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]);
if (decoderState>0) decoderState=1;
corr_dB = dB_fixed64(corr);
diff --git a/openair1/PHY/NR_TRANSPORT/srs_rx.c b/openair1/PHY/NR_TRANSPORT/srs_rx.c
index c16becdb20..2d7aefdee0 100644
--- a/openair1/PHY/NR_TRANSPORT/srs_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/srs_rx.c
@@ -49,6 +49,11 @@ NR_gNB_SRS_t *new_gNB_srs(void){
return (srs);
}
+void free_gNB_srs(NR_gNB_SRS_t *srs)
+{
+ free_and_zero(srs);
+}
+
int nr_find_srs(uint16_t rnti,
int frame,
int slot,
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
index 19d4bf5079..15f3abad79 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_adjust_synch_ue.c
@@ -115,12 +115,6 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
}
}
- if (ue->rx_offset < 0)
- ue->rx_offset += frame_parms->samples_per_frame;
-
- if (ue->rx_offset >= frame_parms->samples_per_frame)
- ue->rx_offset -= frame_parms->samples_per_frame;
-
#ifdef DEBUG_PHY
LOG_D(PHY,"AbsSubframe %d: diff = %i, rx_offset (final) = %i : clear = %d, max_pos = %d, max_pos_fil = %d, max_val = %d, sync_pos %d\n",
subframe,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 84c9627c8a..1b247805a6 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -832,14 +832,18 @@ void nr_pdcch_unscrambling(int16_t *z,
/* This function compares the received DCI bits with
* re-encoded DCI bits and returns the number of mismatched bits
*/
-uint16_t nr_dci_false_detection(uint64_t *dci,
- int16_t *soft_in,
- const t_nrPolar_params *polar_param,
- int encoded_length,
- int rnti) {
+static uint16_t nr_dci_false_detection(uint64_t *dci,
+ int16_t *soft_in,
+ int encoded_length,
+ int rnti,
+ int8_t messageType,
+ uint16_t messageLength,
+ uint8_t aggregation_level
+ ) {
uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
- polar_encoder_fast(dci, (void*)encoder_output, rnti, 1, (t_nrPolar_params *)polar_param);
+ polar_encoder_fast(dci, (void*)encoder_output, rnti, 1,
+ messageType, messageLength, aggregation_level);
uint8_t *enout_p = (uint8_t*)encoder_output;
uint16_t x = 0;
@@ -886,7 +890,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
if (dci_found==1) continue;
int dci_length = rel15->dci_length_options[k];
uint64_t dci_estimation[2]= {0};
- const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList);
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
@@ -901,11 +904,10 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
}
}
#endif
-
uint16_t crc = polar_decoder_int16(tmp_e,
dci_estimation,
1,
- currentPtrDCI);
+ NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
n_rnti = rel15->rnti;
LOG_D(PHY, "(%i.%i) dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d)\n",
@@ -913,7 +915,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
if (crc == n_rnti) {
LOG_D(PHY, "(%i.%i) Received dci indication (rnti %x,dci format %s,n_CCE %d,payloadSize %d,payload %llx)\n",
proc->frame_rx, proc->nr_slot_rx,n_rnti,nr_dci_format_string[rel15->dci_format_options[k]],CCEind,dci_length,*(unsigned long long*)dci_estimation);
- uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,currentPtrDCI,L*108,n_rnti);
+ uint16_t mb = nr_dci_false_detection(dci_estimation,tmp_e,L*108,n_rnti, NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L);
ue->dci_thres = (ue->dci_thres + mb) / 2;
if (mb > (ue->dci_thres+20)) {
LOG_W(PHY,"DCI false positive. Dropping DCI index %d. Mismatched bits: %d/%d. Current DCI threshold: %d\n",j,mb,L*108,ue->dci_thres);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
index 32848951c2..ffa26ad613 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
@@ -79,7 +79,7 @@ void init_dlsch_tpool(uint8_t num_dlsch_threads) {
free(params);
}
-void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) {
+void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
int i,r;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
NR_UE_DLSCH_t *dlsch=*dlschptr;
@@ -131,7 +131,7 @@ void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr,uint8_t N_RB_DL) {
}
}
-NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag) {
+NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_ldpc_iterations,uint16_t N_RB_DL) {
NR_UE_DLSCH_t *dlsch;
uint8_t exit_flag = 0,i,r;
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
@@ -167,30 +167,28 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
else
exit_flag=3;
- if (abstraction_flag == 0) {
- for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
- dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056);
+ for (r=0; rharq_processes[i]->p_nrLDPC_procBuf[r] = nrLDPC_init_mem();
+ dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(1056);
- if (dlsch->harq_processes[i]->c[r])
- memset(dlsch->harq_processes[i]->c[r],0,1056);
- else
- exit_flag=2;
+ if (dlsch->harq_processes[i]->c[r])
+ memset(dlsch->harq_processes[i]->c[r],0,1056);
+ else
+ exit_flag=2;
- dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short));
+ dlsch->harq_processes[i]->d[r] = (short *)malloc16((5*8448)*sizeof(short));
- if (dlsch->harq_processes[i]->d[r])
- memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short));
- else
- exit_flag=2;
+ if (dlsch->harq_processes[i]->d[r])
+ memset(dlsch->harq_processes[i]->d[r],0,(5*8448)*sizeof(short));
+ else
+ exit_flag=2;
- dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short));
+ dlsch->harq_processes[i]->w[r] = (short *)malloc16((5*8448)*sizeof(short));
- if (dlsch->harq_processes[i]->w[r])
- memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short));
- else
- exit_flag=2;
- }
+ if (dlsch->harq_processes[i]->w[r])
+ memset(dlsch->harq_processes[i]->w[r],0,(5*8448)*sizeof(short));
+ else
+ exit_flag=2;
}
} else {
exit_flag=1;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index 075aaecc08..75517b7a6f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -931,12 +931,12 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
for (aarx=0; aarxnb_antennas_rx; aarx++) {
for (aatx=0; aatxnb_antennas_rx+aarx][symbol*nb_rb*12];
for (atx=0; atxnb_antennas_rx+aarx][symbol*nb_rb*12];
dl_ch128_2 = (__m128i *)&dl_ch_estimates_ext[atx*frame_parms->nb_antennas_rx+aarx][symbol*nb_rb*12];
for (rb=0; rbssb_offset);
#endif
+ accumulated_freq_offset += ue->common_vars.freq_offset;
+
// digital compensation of FFO for SSB symbols
- if (ue->UE_fo_compensation){
- double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
- double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample
+ if (ue->UE_fo_compensation){
+ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
+ double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample
- int start = is*fp->samples_per_frame+ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position)
- int end = start + 4*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // loop over samples in 4 symbols (ssb size), including prefix
+ // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1
+ // and we do not know yet in which slot it goes.
- for(int n=start; nnb_antennas_rx; ar++) {
- re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]);
- im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]);
- ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle)));
- ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle)));
- }
- }
+ // start for offset correction
+ int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset;
+
+ // loop over samples
+ int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
+
+ for(int n=start; nnb_antennas_rx; ar++) {
+ re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]);
+ im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]);
+ ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle)));
+ ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle)));
+ }
+ }
}
/* check that SSS/PBCH block is continuous inside the received buffer */
@@ -289,7 +295,34 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
LOG_I(PHY,"Calling sss detection (normal CP)\n");
#endif
- rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp);
+ int freq_offset_sss = 0;
+ rx_sss_nr(ue, proc, &metric_tdd_ncp, &phase_tdd_ncp, &freq_offset_sss);
+
+ accumulated_freq_offset += freq_offset_sss;
+
+ // digital compensation of FFO for SSB symbols
+ if (ue->UE_fo_compensation){
+ double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
+ double off_angle = -2*M_PI*s_time*freq_offset_sss; // offset rotation angle compensation per sample
+
+ // In SA we need to perform frequency offset correction until the end of buffer because we need to decode SIB1
+ // and we do not know yet in which slot it goes.
+
+ // start for offset correction
+ int start = sa ? is*fp->samples_per_frame : is*fp->samples_per_frame + ue->ssb_offset;
+
+ // loop over samples
+ int end = sa ? n_frames*fp->samples_per_frame-1 : start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
+
+ for(int n=start; nnb_antennas_rx; ar++) {
+ re = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n]);
+ im = ((double)(((short *)ue->common_vars.rxdata[ar]))[2*n+1]);
+ ((short *)ue->common_vars.rxdata[ar])[2*n] = (short)(round(re*cos(n*off_angle) - im*sin(n*off_angle)));
+ ((short *)ue->common_vars.rxdata[ar])[2*n+1] = (short)(round(re*sin(n*off_angle) + im*cos(n*off_angle)));
+ }
+ }
+ }
nr_gold_pbch(ue);
ret = nr_pbch_detection(proc, ue, 1); // start pbch detection at first symbol after pss
@@ -304,6 +337,22 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
sync_pos_frame = n_symb_prefix0*(fp->ofdm_symbol_size + fp->nb_prefix_samples0)+(ue->symbol_offset-n_symb_prefix0)*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
// for a correct computation of frame number to sync with the one decoded at MIB we need to take into account in which of the n_frames we got sync
ue->init_sync_frame = n_frames - 1 - is;
+
+ // compute the scramblingID_pdcch and the gold pdcch
+ ue->scramblingID_pdcch = fp->Nid_cell;
+ nr_gold_pdcch(ue,fp->Nid_cell);
+
+ // compute the scrambling IDs for PDSCH DMRS
+ for (int i=0; i<2; i++)
+ ue->scramblingID[i]=fp->Nid_cell;
+
+ nr_gold_pdsch(ue,ue->scramblingID);
+
+ // initialize the pusch dmrs
+ uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell};
+ int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
+ nr_init_pusch_dmrs(ue, N_n_scid, n_scid);
+
// we also need to take into account the shift by samples_per_frame in case the if is true
if (ue->ssb_offset < sync_pos_frame){
ue->rx_offset = fp->samples_per_frame - sync_pos_frame + ue->ssb_offset;
@@ -536,6 +585,8 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
}
if (dec == false) // sib1 not decoded
ret = -1;
+
+ ue->common_vars.freq_offset = accumulated_freq_offset;
}
// exit_fun("debug exit");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_INITIAL_UE_SYNC, VCD_FUNCTION_OUT);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
index dff347f7c0..6b5185dc2c 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_pbch.c
@@ -533,8 +533,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_E,0,0);
//polar decoding de-rate matching
- const t_nrPolar_params *currentPtr = nr_polar_params( NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL,1,&ue->polarList);
- decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,currentPtr);
+ decoderState = polar_decoder_int16(pbch_e_rx,(uint64_t *)&nr_ue_pbch_vars->pbch_a_prime,0,
+ NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL);
if(decoderState) return(decoderState);
@@ -601,7 +601,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
#endif
nr_downlink_indication_t dl_indication;
- fapi_nr_rx_indication_t *rx_ind = calloc(1, sizeof(*rx_ind));
+ fapi_nr_rx_indication_t *rx_ind=calloc(sizeof(*rx_ind),1);
uint16_t number_pdus = 1;
nr_fill_dl_indication(&dl_indication, NULL, rx_ind, proc, ue, gNB_id);
@@ -609,6 +609,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
if (ue->if_inst && ue->if_inst->dl_indication)
ue->if_inst->dl_indication(&dl_indication, NULL);
+ else
+ free(rx_ind); // dl_indication would free(), so free() here if not called
return 0;
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
index 239731208e..9bc3643557 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h
@@ -50,24 +50,23 @@
\brief This function frees memory allocated for a particular DLSCH at UE
@param dlsch Pointer to DLSCH to be removed
*/
-void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch,uint8_t N_RB_DL);
+void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch, uint16_t N_RB_DL);
-/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
+/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft)
\brief This function allocates structures for a particular DLSCH at UE
@returns Pointer to DLSCH to be removed
@param Kmimo Kmimo factor from 36-212/36-213
@param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
@param Nsoft Soft-LLR buffer size from UE-Category
@params N_RB_DL total number of resource blocks (determine the operating BW)
- @param abstraction_flag Flag to indicate abstracted interface
*/
-NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL, uint8_t abstraction_flag);
+NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint16_t N_RB_DL);
-void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch,unsigned char N_RB_UL);
+void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulsch, uint16_t N_RB_UL);
-NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids, uint8_t abstraction_flag);
+NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids);
/** \brief This function computes the LLRs for ML (max-logsum approximation) dual-stream QPSK/QPSK reception.
@param stream0_in Input from channel compensated (MR combined) stream 0
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index 7048c97189..c50cd9ab4f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -272,6 +272,8 @@ typedef struct {
uint8_t dmrsConfigType;
// Number of DMRS CDM groups with no data
uint8_t n_dmrs_cdm_groups;
+ /// DMRS ports bitmap
+ uint16_t dmrs_ports;
/// Starting Symbol number
uint16_t start_symbol;
/// Current subband PMI allocation
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
index 91e14fdfd4..a2e4d0a411 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -43,7 +43,7 @@
//#define DEBUG_ULSCH_CODING
-void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL)
+void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr, uint16_t N_RB_UL)
{
int i, r;
@@ -105,12 +105,8 @@ void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL)
}
-NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
- int number_of_harq_pids,
- uint8_t abstraction_flag)
+NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL, int number_of_harq_pids)
{
- NR_UE_ULSCH_t *ulsch;
- unsigned char exit_flag = 0,i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
if (N_RB_UL != 273) {
@@ -120,97 +116,54 @@ NR_UE_ULSCH_t *new_nr_ue_ulsch(uint16_t N_RB_UL,
uint32_t ulsch_bytes = a_segments*1056; // allocated bytes per segment
- ulsch = (NR_UE_ULSCH_t *)malloc16(sizeof(NR_UE_ULSCH_t));
+ NR_UE_ULSCH_t *ulsch = malloc16(sizeof(NR_UE_ULSCH_t));
+ DevAssert(ulsch);
+ memset(ulsch, 0, sizeof(*ulsch));
- if (ulsch) {
- memset(ulsch,0,sizeof(NR_UE_ULSCH_t));
+ ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES;
+ ulsch->Mlimit = 4; // maximum harq retransmissions
- ulsch->number_harq_processes_for_pusch = NR_MAX_ULSCH_HARQ_PROCESSES;
- ulsch->Mlimit = 4; // maximum harq retransmissions
+ //for (i=0; i<10; i++)
+ //ulsch->harq_ids[i] = 0;
- //for (i=0; i<10; i++)
- //ulsch->harq_ids[i] = 0;
+ for (int i = 0; i < number_of_harq_pids; i++) {
- for (i=0; iharq_processes[i] = malloc16(sizeof(NR_UL_UE_HARQ_t));
+ DevAssert(ulsch->harq_processes[i]);
+ memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t));
- ulsch->harq_processes[i] = (NR_UL_UE_HARQ_t *)malloc16(sizeof(NR_UL_UE_HARQ_t));
+ ulsch->harq_processes[i]->a = malloc16(ulsch_bytes);
+ DevAssert(ulsch->harq_processes[i]->a);
+ bzero(ulsch->harq_processes[i]->a,ulsch_bytes);
- // printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
- if (ulsch->harq_processes[i]) {
- memset(ulsch->harq_processes[i], 0, sizeof(NR_UL_UE_HARQ_t));
- ulsch->harq_processes[i]->b = (uint8_t*)malloc16(ulsch_bytes);
- ulsch->harq_processes[i]->a = (unsigned char*)malloc16(ulsch_bytes);
+ ulsch->harq_processes[i]->b = malloc16(ulsch_bytes);
+ DevAssert(ulsch->harq_processes[i]->b);
+ bzero(ulsch->harq_processes[i]->b,ulsch_bytes);
- if (ulsch->harq_processes[i]->a) {
- bzero(ulsch->harq_processes[i]->a,ulsch_bytes);
- } else {
- printf("Can't allocate PDU\n");
- exit_flag=1;
- }
+ for (int r = 0; r < a_segments; r++) {
+ // account for filler in first segment and CRCs for multiple segment case
+ ulsch->harq_processes[i]->c[r] = malloc16(8448);
+ DevAssert(ulsch->harq_processes[i]->c[r]);
+ bzero(ulsch->harq_processes[i]->c[r],8448);
- if (ulsch->harq_processes[i]->b)
- bzero(ulsch->harq_processes[i]->b,ulsch_bytes);
- else {
- LOG_E(PHY,"Can't get b\n");
- exit_flag=1;
- }
-
- if (abstraction_flag==0) {
- for (r=0; rharq_processes[i]->c[r] = (uint8_t*)malloc16(8448);
- ulsch->harq_processes[i]->d[r] = (uint8_t*)malloc16(68*384); //max size for coded output
-
- if (ulsch->harq_processes[i]->c[r]) {
- bzero(ulsch->harq_processes[i]->c[r],8448);
- } else {
- printf("Can't get c\n");
- exit_flag=2;
- }
- if (ulsch->harq_processes[i]->d[r]) {
- bzero(ulsch->harq_processes[i]->d[r],(68*384));
- } else {
- printf("Can't get d\n");
- exit_flag=2;
- }
- }
- ulsch->harq_processes[i]->e = (uint8_t*)malloc16(14*N_RB_UL*12*8);
- if (ulsch->harq_processes[i]->e) {
- bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8);
- } else {
- printf("Can't get e\n");
- exit_flag=1;
- }
- ulsch->harq_processes[i]->f = (uint8_t*)malloc16(14*N_RB_UL*12*8);
- if (ulsch->harq_processes[i]->f) {
- bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8);
- } else {
- printf("Can't get f\n");
- exit_flag=1;
- }
- }
-
- ulsch->harq_processes[i]->subframe_scheduling_flag = 0;
- ulsch->harq_processes[i]->first_tx = 1;
- } else {
- LOG_E(PHY,"Can't get harq_p %d\n",i);
- exit_flag=3;
- }
+ ulsch->harq_processes[i]->d[r] = malloc16(68*384); //max size for coded output
+ DevAssert(ulsch->harq_processes[i]->d[r]);
+ bzero(ulsch->harq_processes[i]->d[r],(68*384));
}
- if (exit_flag==0) {
- for (i=0; iharq_processes[i]->round=0;
- }
- return(ulsch);
- }
+ ulsch->harq_processes[i]->e = malloc16(14*N_RB_UL*12*8);
+ DevAssert(ulsch->harq_processes[i]->e);
+ bzero(ulsch->harq_processes[i]->e,14*N_RB_UL*12*8);
+
+ ulsch->harq_processes[i]->f = malloc16(14*N_RB_UL*12*8);
+ DevAssert(ulsch->harq_processes[i]->f);
+ bzero(ulsch->harq_processes[i]->f,14*N_RB_UL*12*8);
+
+ ulsch->harq_processes[i]->subframe_scheduling_flag = 0;
+ ulsch->harq_processes[i]->first_tx = 1;
}
- LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
- free_nr_ue_ulsch(&ulsch,N_RB_UL);
- return(NULL);
-
-
+ return(ulsch);
}
@@ -261,9 +214,9 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_UE_ULSCH_ENCODING, VCD_FUNCTION_IN);
- LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
- LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
- LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",
+ LOG_D(NR_PHY, "ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
+ LOG_D(NR_PHY, "ulsch coding A %d G %d mod_order %d\n", A, G, mod_order);
+ LOG_D(NR_PHY, "harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",
harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator);
if (harq_process->first_tx == 1 ||
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 0c188e9119..41cf9c2ffa 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -128,7 +128,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
uint8_t num_of_codewords = 1; // tmp assumption
- int Nid_cell = 0;
int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
uint16_t number_dmrs_symbols = 0;
@@ -153,7 +152,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
if (start_sc >= frame_parms->ofdm_symbol_size)
start_sc -= frame_parms->ofdm_symbol_size;
- ulsch_ue->Nid_cell = Nid_cell;
+ ulsch_ue->Nid_cell = frame_parms->Nid_cell;
for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
if((ul_dmrs_symb_pos >> i) & 0x01)
@@ -391,7 +390,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
// Perform this on gold sequence, not required when SC FDMA operation is done,
LOG_D(PHY,"DMRS in symbol %d\n",l);
nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
-
+
} else {
dmrs_idx = 0;
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
index 28b6677b2c..88bdc3a9cd 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/pss_nr.c
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include "PHY/defs_nr_UE.h"
@@ -439,33 +440,10 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
void free_context_pss_nr(void)
{
for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) {
-
- if (primary_synchro_time_nr[i] != NULL) {
- free(primary_synchro_time_nr[i]);
- primary_synchro_time_nr[i] = NULL;
- }
- else {
- LOG_E(PHY,"Fatal memory deallocation problem \n");
- assert(0);
- }
-
- if (primary_synchro_nr[i] != NULL) {
- free(primary_synchro_nr[i]);
- primary_synchro_nr[i] = NULL;
- }
- else {
- LOG_E(PHY,"Fatal memory deallocation problem \n");
- assert(0);
- }
-
- if (pss_corr_ue[i] != NULL) {
- free(pss_corr_ue[i]);
- pss_corr_ue[i] = NULL;
- }
- else {
- LOG_E(PHY,"Fatal memory deallocation problem \n");
- assert(0);
- }
+ free_and_zero(primary_synchro_nr[i]);
+ free_and_zero(primary_synchro_nr2[i]);
+ free_and_zero(primary_synchro_time_nr[i]);
+ free_and_zero(pss_corr_ue[i]);
}
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
index ddec605253..4dcce9f60f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
@@ -850,7 +850,7 @@ static inline void nr_pucch2_3_4_scrambling(uint16_t M_bit,uint16_t rnti,uint16_
printf("\t\t [nr_pucch2_3_4_scrambling] scrambling M_bit=%d bits\n", M_bit);
#endif
}
-void nr_uci_encoding(uint64_t payload,
+static void nr_uci_encoding(uint64_t payload,
uint8_t nr_bit,
int fmt,
uint8_t is_pi_over_2_bpsk_enabled,
@@ -946,12 +946,10 @@ void nr_uci_encoding(uint64_t payload,
AssertFatal(nrofPRB<=16,"Number of PRB >16\n");
} else if (A>=12) {
AssertFatal(A<65,"Polar encoding not supported yet for UCI with more than 64 bits\n");
- t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_UCI_PUCCH_MESSAGE_TYPE,
- A,
- nrofPRB,
- 1,
- NULL);
- polar_encoder_fast(&payload, b, 0,0,currentPtr);
+ polar_encoder_fast(&payload, b, 0,0,
+ NR_POLAR_UCI_PUCCH_MESSAGE_TYPE,
+ A,
+ nrofPRB);
}
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
index 9339f3974d..dc73fe0add 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
@@ -420,7 +420,7 @@ int pss_sss_extract_nr(PHY_VARS_NR_UE *phy_vars_ue,
*
*********************************************************************/
-int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max)
+int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric, uint8_t *phase_max, int *freq_offset_sss)
{
uint8_t i;
int32_t pss_ext[NB_ANTENNAS_RX][LENGTH_PSS_NR];
@@ -558,5 +558,19 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
}
//#endif
+ int re = 0;
+ int im = 0;
+ d = (int16_t *)&d_sss[Nid2][Nid1];
+ for(i = 0; isubcarrier_spacing);
+
+ double ffo_pss = ((double)ue->common_vars.freq_offset)/frame_parms->subcarrier_spacing;
+ LOG_I(NR_PHY, "ffo_pss %f (%i Hz), ffo_sss %f (%i Hz), ffo_pss+ffo_sss %f (%i Hz)\n",
+ ffo_pss, (int)(ffo_pss*frame_parms->subcarrier_spacing), ffo_sss, *freq_offset_sss, ffo_pss+ffo_sss, (int)((ffo_pss+ffo_sss)*frame_parms->subcarrier_spacing));
+
return(0);
}
diff --git a/openair1/PHY/TOOLS/lte_enb_scope.c b/openair1/PHY/TOOLS/lte_enb_scope.c
index 7fde9f244c..0e873addbc 100644
--- a/openair1/PHY/TOOLS/lte_enb_scope.c
+++ b/openair1/PHY/TOOLS/lte_enb_scope.c
@@ -49,12 +49,6 @@ void reset_stats(FL_OBJECT *button, long arg) {
int i,j,k;
PHY_VARS_eNB *phy_vars_eNB = RC.eNB[0][0];
- printf("XXX %d %d %d\n",
- sizeofArray(phy_vars_eNB->UE_stats),
- sizeofArray( phy_vars_eNB->UE_stats[i].dlsch_NAK),
- sizeofArray( *phy_vars_eNB->UE_stats[i].dlsch_NAK)
- );
-
for (i=0; iUE_stats); i++) {
for (k=0; kUE_stats[i].dlsch_NAK); k++) { //harq_processes
for (j=0; jUE_stats[i].dlsch_NAK); j++) {
diff --git a/openair1/PHY/defs_UE.h b/openair1/PHY/defs_UE.h
index 2d2697a4b7..fc3d939f65 100644
--- a/openair1/PHY/defs_UE.h
+++ b/openair1/PHY/defs_UE.h
@@ -55,7 +55,6 @@
#include
#include
#include "common_lib.h"
-#include "msc.h"
#include "defs_common.h"
#include "impl_defs_top.h"
diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h
index a371b2334b..c79530434a 100644
--- a/openair1/PHY/defs_common.h
+++ b/openair1/PHY/defs_common.h
@@ -54,7 +54,6 @@
#include
#include
#include "common_lib.h"
-#include "msc.h"
#include
#include "assertions.h"
diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h
index 030d50bc04..995a4a934e 100644
--- a/openair1/PHY/defs_eNB.h
+++ b/openair1/PHY/defs_eNB.h
@@ -55,7 +55,6 @@
#include
#include "common_lib.h"
-#include "msc.h"
#include "defs_common.h"
#include "defs_RU.h"
#include "impl_defs_top.h"
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 5e3a541d20..837c043f8b 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -779,7 +779,7 @@ typedef struct PHY_VARS_gNB_s {
/// statistics for ULSCH measurement collection
NR_gNB_SCH_STATS_t ulsch_stats[NUMBER_OF_NR_SCH_STATS_MAX];
NR_gNB_UCI_STATS_t uci_stats[NUMBER_OF_NR_UCI_STATS_MAX];
- t_nrPolar_params *uci_polarParams;
+ t_nrPolar_params **polarParams;
/// SRS variables
nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX];
diff --git a/openair1/PHY/defs_nr_UE.h b/openair1/PHY/defs_nr_UE.h
index bca956bf75..653b435e12 100644
--- a/openair1/PHY/defs_nr_UE.h
+++ b/openair1/PHY/defs_nr_UE.h
@@ -44,7 +44,6 @@
#include
#include
#include "common_lib.h"
-#include "msc.h"
#include "fapi_nr_ue_interface.h"
#include "assertions.h"
@@ -815,7 +814,6 @@ typedef struct {
fapi_nr_config_request_t nrUE_config;
- t_nrPolar_params *polarList;
NR_UE_PDSCH *pdsch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX+1]; // two RxTx Threads
NR_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_gNB_MAX];
NR_UE_PDCCH *pdcch_vars[RX_NB_TH_MAX][NUMBER_OF_CONNECTED_gNB_MAX];
diff --git a/openair1/PHY/defs_nr_common.h b/openair1/PHY/defs_nr_common.h
index 78599dcbb6..d3352fb520 100644
--- a/openair1/PHY/defs_nr_common.h
+++ b/openair1/PHY/defs_nr_common.h
@@ -387,8 +387,6 @@ struct NR_DL_FRAME_PARMS {
uint8_t N_ssb;
/// SSB index
uint8_t ssb_index;
- /// PBCH polar encoder params
- t_nrPolar_params pbch_polar_params;
/// OFDM symbol offset divisor for UL
uint32_t ofdm_offset_divisor;
};
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index 569d2a464a..ee1e0be49a 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -43,7 +43,6 @@
#include
#include "assertions.h"
-#include "msc.h"
#include
diff --git a/openair1/SCHED/prach_procedures.c b/openair1/SCHED/prach_procedures.c
index 4d0fe428e8..805354ce1b 100644
--- a/openair1/SCHED/prach_procedures.c
+++ b/openair1/SCHED/prach_procedures.c
@@ -40,7 +40,6 @@
#include "assertions.h"
-#include "msc.h"
#include
diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c
index 15eba7b5bc..dc84279a96 100644
--- a/openair1/SCHED/ru_procedures.c
+++ b/openair1/SCHED/ru_procedures.c
@@ -69,7 +69,6 @@
#include "assertions.h"
#include "common/utils/system.h"
-#include "msc.h"
#include
diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c
index 1ea8dbdf3c..b0f59d5f47 100644
--- a/openair1/SCHED_NR/nr_prach_procedures.c
+++ b/openair1/SCHED_NR/nr_prach_procedures.c
@@ -41,7 +41,6 @@
#include "assertions.h"
-#include "msc.h"
#include
diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c
index 4d3174007a..b90f14a129 100644
--- a/openair1/SCHED_NR/nr_ru_procedures.c
+++ b/openair1/SCHED_NR/nr_ru_procedures.c
@@ -44,7 +44,6 @@
#include "T.h"
#include "assertions.h"
-#include "msc.h"
#include
// RU OFDM Modulator gNodeB
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 7e9f4d091a..41f395c090 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -39,7 +39,6 @@
#include "executables/softmodem-common.h"
#include "assertions.h"
-#include "msc.h"
#include
@@ -89,7 +88,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
nr_generate_pss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
nr_generate_sss(&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
- if (cfg->carrier_config.num_tx_ant.value <= 4)
+ if (fp->Lmax == 4)
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
@@ -190,7 +189,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
//apply the OFDM symbol rotation here
for (aa=0; aacarrier_config.num_tx_ant.value; aa++) {
- apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
+ apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h
index d7e0332b85..2124397c47 100644
--- a/openair1/SCHED_NR/sched_nr.h
+++ b/openair1/SCHED_NR/sched_nr.h
@@ -54,5 +54,6 @@ void nr_fep_full(RU_t *ru, int slot);
void nr_fep_full_2thread(RU_t *ru, int slot);
void feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
int nr_phy_init_RU(RU_t *ru);
+void nr_phy_free_RU(RU_t *ru);
#endif
diff --git a/openair1/SCHED_NR/vars.h b/openair1/SCHED_NR/vars.h
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h
index b85d4c1b50..c362bb470f 100644
--- a/openair1/SCHED_NR_UE/defs.h
+++ b/openair1/SCHED_NR_UE/defs.h
@@ -295,9 +295,6 @@ uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n);
uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n);
-uint16_t nr_get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
-
-
int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
/*! \brief UL time alignment procedures for TA application
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
index c8386b881e..d4b4feeeee 100644
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
@@ -90,8 +90,11 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu));
memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu));
rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti;
- rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
- rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi;
+ /* TODO: Implement channel modeling to abstract TA and CQI. For now,
+ we hard code the values below since they are set in L1 and we are
+ abstracting L1. */
+ rx_ind->pdu_list[j].timing_advance = 31;
+ rx_ind->pdu_list[j].ul_cqi = 255;
char buffer[1024];
hexdump(rx_ind->pdu_list[j].pdu, rx_ind->pdu_list[j].pdu_length, buffer, sizeof(buffer));
LOG_D(NR_MAC, "Hexdump of pdu %s before queuing rx_ind\n",
@@ -113,7 +116,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb;
crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti;
crc_ind->crc_list[j].tb_crc_status = 0;
- crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
+ crc_ind->crc_list[j].timing_advance = 31;
crc_ind->crc_list[j].ul_cqi = 255;
}
@@ -204,6 +207,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
}
}
}
+ dl_config->number_pdus = 0;
}
}
@@ -284,14 +288,15 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups;
+ dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports;
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
dlsch0_harq->tbslbrm = dlsch_config_pdu->tbslbrm;
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
//get nrOfLayers from DCI info
uint8_t Nl = 0;
- for (i = 0; i < 4; i++) {
- if (dlsch_config_pdu->dmrs_ports[i] >= i) Nl += 1;
+ for (i = 0; i < 12; i++) { // max 12 ports
+ if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1;
}
dlsch0_harq->Nl = Nl;
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
@@ -309,7 +314,8 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
- LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
+ LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n",
+ dlsch0->g_pucch, dlsch0_harq->mcs);
}
}
}
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index 97a7e2e489..996ee2538c 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -561,23 +561,23 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
uint16_t s1 = dlsch0_harq->nb_symbols;
bool is_SI = dlsch0->rnti_type == _SI_RNTI_;
- LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x\n",
- ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos);
+ LOG_D(PHY,"[UE %d] PDSCH type %d active in nr_slot_rx %d, harq_pid %d (%d), rb_start %d, nb_rb %d, symbol_start %d, nb_symbols %d, DMRS mask %x, Nl %d\n",
+ ue->Mod_id,pdsch,nr_slot_rx,harq_pid,dlsch0_harq->status,pdsch_start_rb,pdsch_nb_rb,s0,s1,dlsch0_harq->dlDmrsSymbPos, dlsch0_harq->Nl);
for (m = s0; m < (s0 +s1); m++) {
if (dlsch0_harq->dlDmrsSymbPos & (1 << m)) {
for (uint8_t aatx=0; aatxNl; aatx++) {//for MIMO Config: it shall loop over no_layers
+ LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m);
nr_pdsch_channel_estimation(ue,
proc,
gNB_id,
is_SI,
nr_slot_rx,
- aatx /*p*/,
+ get_dmrs_port(aatx,dlsch0_harq->dmrs_ports),
m,
BWPStart,
ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12,
pdsch_nb_rb);
- LOG_D(PHY,"PDSCH Channel estimation gNB id %d, PDSCH antenna port %d, slot %d, symbol %d\n",0,aatx,nr_slot_rx,m);
#if 0
///LOG_M: the channel estimation
int nr_frame_rx = proc->frame_rx;
@@ -1528,7 +1528,6 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
// do procedures for C-RNTI
int ret_pdsch = 0;
if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) {
-
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN);
ret_pdsch = nr_ue_pdsch_procedures(ue,
proc,
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index c1443700f3..495b6803a6 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -64,6 +64,13 @@
void feptx_ofdm(RU_t *ru, int frame, int subframe);
void feptx_prec(RU_t *ru, int frame, int subframe);
+const char *__asan_default_options()
+{
+ /* don't do leak checking in nr_ulsim, not finished yet */
+ return "detect_leaks=0";
+}
+
+
double cpuf;
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
//#define MCS_COUNT 23//added for PHY abstraction
@@ -140,7 +147,7 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
}
void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
- double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2],FILE *csv_fd) {
+ double *s_re[NB_ANTENNAS_TX],double *s_im[NB_ANTENNAS_TX],double *r_re[NB_ANTENNAS_RX],double *r_im[NB_ANTENNAS_RX],FILE *csv_fd) {
int i,u;
int aa,aarx,aatx;
double channelx,channely;
@@ -1538,9 +1545,9 @@ int main(int argc, char **argv) {
LOG_M("txsig0.m","txs0", &ru->common.txdata[0][subframe* eNB->frame_parms.samples_per_tti], eNB->frame_parms.samples_per_tti,1,1);
if (transmission_mode<7) {
- LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("txsigF0.m","txsF0x", &ru->common.txdataF_BF[0][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
} else if (transmission_mode == 7) {
- LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("txsigF0.m","txsF0", &ru->common.txdataF_BF[5][0],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
LOG_M("txsigF0_BF.m","txsF0_BF", &ru->common.txdataF_BF[0][0],eNB->frame_parms.ofdm_symbol_size,1,1);
}
}
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index 1b1058535e..a1894d03d7 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -58,6 +58,12 @@
#include "common/ran_context.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
+const char *__asan_default_options()
+{
+ /* don't do leak checking in ulsim, not finished yet */
+ return "detect_leaks=0";
+}
+
double cpuf;
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
//#define MCS_COUNT 23//added for PHY abstraction
@@ -334,10 +340,10 @@ int main(int argc, char **argv) {
double s_re1[30720],s_im1[30720],r_re1[30720],r_im1[30720];
double r_re2[30720],r_im2[30720];
double r_re3[30720],r_im3[30720];
- double *s_re[2]= {s_re0,s_re1};
- double *s_im[2]= {s_im0,s_im1};
- double *r_re[4]= {r_re0,r_re1,r_re2,r_re3};
- double *r_im[4]= {r_im0,r_im1,r_im2,r_im3};
+ double *s_re[NB_ANTENNAS_TX]= {s_re0,s_re1, NULL, NULL};
+ double *s_im[NB_ANTENNAS_TX]= {s_im0,s_im1, NULL, NULL};
+ double *r_re[NB_ANTENNAS_RX]= {r_re0,r_re1,r_re2,r_re3};
+ double *r_im[NB_ANTENNAS_RX]= {r_im0,r_im1,r_im2,r_im3};
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
double iqim=0.0;
int cqi_error,cqi_errors,ack_errors,cqi_crc_falsepositives,cqi_crc_falsenegatives;
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index a0dd1b433d..eeb90a0a9d 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -29,6 +29,7 @@
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
+#include "common/utils/load_module_shlib.h"
#include "T.h"
#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_common.h"
@@ -356,7 +357,7 @@ int main(int argc, char **argv)
}
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
- RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
+ RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB));
gNB = RC.gNB[0];
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
initTpool(gNBthreads, gNB->threadPool, true);
@@ -413,7 +414,7 @@ int main(int argc, char **argv)
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
//phy_init_nr_top(frame_parms);
- if (init_nr_ue_signal(UE, 1, 0) != 0) {
+ if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
@@ -422,8 +423,7 @@ int main(int argc, char **argv)
//init_nr_ue_transport(UE, 0);
for (int sf = 0; sf < 2; sf++) {
for (i = 0; i < 2; i++) {
- UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL,
- 0);
+ UE->dlsch[sf][0][i] = new_nr_ue_dlsch(Kmimo, 8, Nsoft, 5, N_RB_DL);
if (!UE->dlsch[sf][0][i]) {
printf("Can't get ue dlsch structures\n");
@@ -434,8 +434,6 @@ int main(int argc, char **argv)
}
}
- UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
- UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
processingData_L1tx_t msgDataTx;
init_DLSCH_struct(gNB, &msgDataTx);
@@ -474,16 +472,13 @@ int main(int argc, char **argv)
rel15->mcsIndex[0] = Imcs;
rel15->numDmrsCdmGrpsNoData = 1;
rel15->maintenance_parms_v3.tbSizeLbrmBytes = Tbslbrm;
- double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
- short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384);
- short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384);
+ double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
+ short channel_output_fixed[16 * 68 * 384];
//unsigned char *estimated_output;
- unsigned char *estimated_output_bit;
- unsigned char *test_input_bit;
unsigned int errors_bit = 0;
- test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
+ unsigned char test_input_bit[16 * 68 * 384];
//estimated_output = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
- estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
+ unsigned char estimated_output_bit[16 * 68 * 384];
NR_UE_DLSCH_t *dlsch0_ue = UE->dlsch[0][0][0];
NR_DL_UE_HARQ_t *harq_process = dlsch0_ue->harq_processes[harq_pid];
harq_process->mcs = Imcs;
@@ -498,9 +493,10 @@ int main(int argc, char **argv)
harq_process->n_dmrs_cdm_groups = 1;
harq_process->tbslbrm = Tbslbrm;
printf("harq process ue mcs = %d Qm = %d, symb %d\n", harq_process->mcs, harq_process->Qm, nb_symb_sch);
+
unsigned char *test_input;
test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8);
-
+ //unsigned char test_input[TBS / 8] __attribute__ ((aligned(16)));
for (i = 0; i < TBS / 8; i++)
test_input[i] = (unsigned char) rand();
@@ -557,12 +553,6 @@ int main(int argc, char **argv)
i,modulated_input[i],
i,channel_output_fixed[i]);
*/
-
- //Uncoded BER
- if (channel_output_fixed[i] < 0)
- channel_output_uncoded[i] = 1; //QPSK demod
- else
- channel_output_uncoded[i] = 0;
}
#ifdef DEBUG_CODER
@@ -644,12 +634,22 @@ int main(int argc, char **argv)
}
}*/
- for (i = 0; i < 2; i++) {
- printf("gNB %d\n", i);
- free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL);
- printf("UE %d\n", i);
- free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL);
- }
+ free(test_input);
+
+ free_channel_desc_scm(gNB2UE);
+
+ reset_DLSCH_struct(gNB, &msgDataTx);
+
+ phy_free_nr_gNB(gNB);
+ free(gNB->threadPool);
+ free(RC.gNB[0]);
+ free(RC.gNB);
+
+ for (int sf = 0; sf < 2; sf++)
+ for (int i = 0; i < 2; i++)
+ free_nr_ue_dlsch(&UE->dlsch[sf][0][i], N_RB_DL);
+ term_nr_ue_signal(UE, 1);
+ free(UE);
for (i = 0; i < 2; i++) {
free(s_re[i]);
@@ -674,6 +674,9 @@ int main(int argc, char **argv)
if (ouput_vcd)
vcd_signal_dumper_close();
+ loader_reset();
+ logTerm();
+
return (n_errors);
}
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index b8f51f8e95..cfc7cb00b0 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -73,6 +73,12 @@
#include
#include
+const char *__asan_default_options()
+{
+ /* don't do leak checking in nr_ulsim, not finished yet */
+ return "detect_leaks=0";
+}
+
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
@@ -175,7 +181,12 @@ gtpv1u_update_ngu_tunnel(
return 0;
}
-int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
+int gtpv1u_delete_ngu_tunnel( const instance_t instance,
+ gtpv1u_gnb_delete_tunnel_req_t *req) {
return 0;
}
@@ -271,17 +282,13 @@ void nr_dlsim_preprocessor(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
- ps->nrOfLayers = g_nrOfLayers;
-
- int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ?
- NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
-
nr_set_pdsch_semi_static(scc,
UE_info->CellGroup[0],
sched_ctrl->active_bwp,
NULL,
/* tda = */ 2,
- dci_format,
+ g_nrOfLayers,
+ sched_ctrl,
ps);
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
@@ -777,7 +784,8 @@ int main(int argc, char **argv)
prepare_scd(scd);
- fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0, 0);
+ fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 6, 0, 0, 0);
+
/* RRC parameter validation for secondaryCellGroup */
fix_scd(scd);
@@ -796,9 +804,9 @@ int main(int argc, char **argv)
AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface");
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
// common configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 0, 0, NULL);
// UE dedicated configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
// reset preprocessor to the one of DLSIM after it has been set during
// rrc_mac_config_req_gNB
gNB_mac->pre_processor_dl = nr_dlsim_preprocessor;
@@ -915,16 +923,25 @@ int main(int argc, char **argv)
UE->perfect_ce = 0;
- if (init_nr_ue_signal(UE, 1, 0) != 0)
+ if (init_nr_ue_signal(UE, 1) != 0)
{
printf("Error at UE NR initialisation\n");
exit(-1);
}
- init_nr_ue_transport(UE,0);
+ init_nr_ue_transport(UE);
nr_gold_pbch(UE);
- nr_gold_pdcch(UE,0);
+
+ // compute the scramblingID_pdcch and the gold pdcch
+ UE->scramblingID_pdcch = frame_parms->Nid_cell;
+ nr_gold_pdcch(UE, frame_parms->Nid_cell);
+
+ // compute the scrambling IDs for PDSCH DMRS
+ for (int i = 0; i < 2; i++)
+ UE->scramblingID[i] = frame_parms->Nid_cell;
+
+ nr_gold_pdsch(UE, UE->scramblingID);
nr_l2_init_ue(NULL);
UE_mac = get_mac_inst(0);
@@ -1216,7 +1233,7 @@ int main(int argc, char **argv)
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
nr_ue_scheduled_response(&scheduled_response);
-
+
phy_procedures_nrUE_RX(UE,
&UE_proc,
0,
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index c6b547cd79..f3a8d21fdd 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -27,6 +27,7 @@
#include
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
+#include "common/utils/load_module_shlib.h"
#include "common/ran_context.h"
#include "common/utils/nr/nr_common.h"
#include "PHY/types.h"
@@ -202,15 +203,15 @@ int main(int argc, char **argv)
float target_error_rate = 0.01;
+ int seed = 0;
+
cpuf = get_cpu_freq_GHz();
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) {
exit_fun("[NR_PBCHSIM] 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:M:N:F:GR:dP:IL:m:")) != -1) {
+ while ((c = getopt (argc, argv, "F:g:hIL:m:M:n:N:o:P:r:R:s:S:x:y:z:")) != -1) {
switch (c) {
/*case 'f':
write_output_file=1;
@@ -227,6 +228,14 @@ int main(int argc, char **argv)
frame_type = 1;
break;*/
+ case 'F':
+ input_fd = fopen(optarg,"r");
+ if (input_fd==NULL) {
+ printf("Problem with filename %s. Exiting.\n", optarg);
+ exit(-1);
+ }
+ break;
+
case 'g':
switch((char)*optarg) {
case 'A':
@@ -264,18 +273,42 @@ int main(int argc, char **argv)
break;
- /*case 'i':
+ /*
+ case 'i':
interf1=atoi(optarg);
break;
+ */
+ case 'I':
+ run_initial_sync=1;
+ target_error_rate=0.1;
+ break;
+
+ /*
case 'j':
interf2=atoi(optarg);
break;*/
+ case 'L':
+ loglvl = atoi(optarg);
+ break;
+
+ case 'm':
+ mu = atoi(optarg);
+ break;
+
+ case 'M':
+ SSB_positions = atoi(optarg);
+ break;
+
case 'n':
n_trials = atoi(optarg);
break;
+ case 'N':
+ Nid_cell = atoi(optarg);
+ break;
+
case 'o':
cfo = atof(optarg);
#ifdef DEBUG_NR_PBCHSIM
@@ -283,6 +316,34 @@ int main(int argc, char **argv)
#endif
break;
+ /*case 'p':
+ extended_prefix_flag=1;
+ break;*/
+
+ case 'P':
+ pbch_phase = atoi(optarg);
+ if (pbch_phase>3)
+ printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase);
+ break;
+
+ /*
+ case 'r':
+ ricean_factor = pow(10,-.1*atof(optarg));
+ if (ricean_factor>1) {
+ printf("Ricean factor must be between 0 and 1\n");
+ exit(-1);
+ }
+ break;
+ */
+
+ case 'r':
+ seed = atoi(optarg);
+ break;
+
+ case 'R':
+ N_RB_DL = atoi(optarg);
+ break;
+
case 's':
snr0 = atof(optarg);
#ifdef DEBUG_NR_PBCHSIM
@@ -303,19 +364,7 @@ int main(int argc, char **argv)
Td= atof(optarg);
break;
*/
- /*case 'p':
- extended_prefix_flag=1;
- break;*/
- /*
- case 'r':
- ricean_factor = pow(10,-.1*atof(optarg));
- if (ricean_factor>1) {
- printf("Ricean factor must be between 0 and 1\n");
- exit(-1);
- }
- break;
- */
case 'x':
transmission_mode=atoi(optarg);
@@ -328,99 +377,58 @@ int main(int argc, char **argv)
case 'y':
n_tx=atoi(optarg);
-
if ((n_tx==0) || (n_tx>2)) {
- printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx);
+ printf("Unsupported number of TX antennas %d. Exiting.\n", n_tx);
exit(-1);
}
-
break;
case 'z':
n_rx=atoi(optarg);
-
if ((n_rx==0) || (n_rx>2)) {
- printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx);
+ printf("Unsupported number of RX antennas %d. Exiting.\n", n_rx);
exit(-1);
}
-
- break;
-
- case 'M':
- SSB_positions = atoi(optarg);
- break;
-
- case 'N':
- Nid_cell = atoi(optarg);
- break;
-
- case 'R':
- N_RB_DL = atoi(optarg);
- break;
-
- case 'F':
- input_fd = fopen(optarg,"r");
-
- if (input_fd==NULL) {
- printf("Problem with filename %s. Exiting.\n", optarg);
- exit(-1);
- }
-
- break;
-
- case 'P':
- pbch_phase = atoi(optarg);
-
- if (pbch_phase>3)
- printf("Illegal PBCH phase (0-3) got %d\n",pbch_phase);
-
- break;
-
- case 'I':
- run_initial_sync=1;
- target_error_rate=0.1;
- break;
-
- case 'L':
- loglvl = atoi(optarg);
- break;
-
- case 'm':
- mu = atoi(optarg);
break;
default:
case 'h':
- printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n",
+ printf("%s -F input_filename -g channel_mod -h(elp) -I(nitial sync) -L log_lvl -n n_frames -M SSBs -n frames -N cell_id -o FO -P phase -r seed -R RBs -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant\n",
argv[0]);
- printf("-h This message\n");
- //printf("-p Use extended prefix mode\n");
+ //printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
+ //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
//printf("-d Use TDD\n");
- printf("-n Number of frames to simulate\n");
- printf("-m Numerology index\n");
- printf("-s Starting SNR, runs from SNR0 to SNR0 + 5 dB. If n_frames is 1 then just SNR is simulated\n");
- printf("-S Ending SNR, runs from SNR0 to SNR1\n");
- printf("-t Delay spread for multipath channel\n");
+ //printf("-f Output filename (.txt format) for Pe/SNR results\n");
+ printf("-F Input filename (.txt format) for RX conformance testing\n");
printf("-g [A,B,C,D,E,F,G] Use 3GPP SCM (A,B,C,D) or 36-101 (E-EPA,F-EVA,G-ETU) models (ignores delay spread and Ricean factor)\n");
+ printf("-h This message\n");
+ //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
+ printf("-I run initial sync with target error rate 0.1\n");
+ //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
+ printf("-L set the log level (-1 disable, 0 error, 1 warning, 2 info, 3 debug, 4 trace)\n");
+ printf("-m Numerology index\n");
+ printf("-M Multiple SSB positions in burst\n");
+ printf("-n Number of frames to simulate\n");
+ printf("-N Nid_cell\n");
+ printf("-o Carrier frequency offset in Hz\n");
+ //printf("-O oversampling factor (1,2,4,8,16)\n");
+ //printf("-p Use extended prefix mode\n");
+ printf("-P PBCH phase, allowed values 0-3\n");
+ printf("-r set the random number generator seed (default: 0 = current time)\n");
+ printf("-R N_RB_DL\n");
+ printf("-s Starting SNR, runs from SNR0 to SNR0 + 10 dB if not -S given. If -n 1, then just SNR is simulated\n");
+ printf("-S Ending SNR, runs from SNR0 to SNR1\n");
+ //printf("-t Delay spread for multipath channel\n");
printf("-x Transmission mode (1,2,6 for the moment)\n");
printf("-y Number of TX antennas used in eNB\n");
printf("-z Number of RX antennas used in UE\n");
- //printf("-i Relative strength of first intefering eNB (in dB) - cell_id mod 3 = 1\n");
- //printf("-j Relative strength of second intefering eNB (in dB) - cell_id mod 3 = 2\n");
- printf("-o Carrier frequency offset in Hz\n");
- printf("-M Multiple SSB positions in burst\n");
- printf("-N Nid_cell\n");
- printf("-R N_RB_DL\n");
- printf("-O oversampling factor (1,2,4,8,16)\n");
- printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
- //printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
- //printf("-f Output filename (.txt format) for Pe/SNR results\n");
- printf("-F Input filename (.txt format) for RX conformance testing\n");
exit (-1);
break;
}
}
+ randominit(seed);
+
logInit();
set_glog(loglvl);
T_stdout = 1;
@@ -431,12 +439,13 @@ int main(int argc, char **argv)
printf("Initializing gNodeB for mu %d, N_RB_DL %d\n",mu,N_RB_DL);
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
- RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
+ RC.gNB[0] = malloc16_clear(sizeof(*(RC.gNB[0])));
gNB = RC.gNB[0];
gNB->ofdm_offset_divisor = UINT_MAX;
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;
+ frame_parms->nb_antenna_ports_gNB = n_tx;
frame_parms->N_RB_DL = N_RB_DL;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = Nid_cell%4;
@@ -526,19 +535,13 @@ int main(int argc, char **argv)
for (i=0; i<2; i++) {
- s_re[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(s_re[i],frame_length_complex_samples*sizeof(double));
- s_im[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(s_im[i],frame_length_complex_samples*sizeof(double));
-
- r_re[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(r_re[i],frame_length_complex_samples*sizeof(double));
- r_im[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(r_im[i],frame_length_complex_samples*sizeof(double));
+ s_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
+ s_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
+ r_re[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
+ r_im[i] = malloc16_clear(frame_length_complex_samples*sizeof(double));
printf("Allocating %d samples for txdata\n",frame_length_complex_samples);
- txdata[i] = malloc(frame_length_complex_samples*sizeof(int));
- bzero(r_re[i],frame_length_complex_samples*sizeof(int));
+ txdata[i] = malloc16_clear(frame_length_complex_samples*sizeof(int));
}
if (pbch_file_fd!=NULL) {
@@ -547,8 +550,8 @@ int main(int argc, char **argv)
//configure UE
- UE = malloc(sizeof(PHY_VARS_NR_UE));
- memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
+ UE = malloc16_clear(sizeof(*UE));
+ memcpy(&UE->frame_parms,frame_parms,sizeof(UE->frame_parms));
//phy_init_nr_top(UE); //called from init_nr_ue_signal
if (run_initial_sync==1) UE->is_synchronized = 0;
else UE->is_synchronized = 1;
@@ -558,7 +561,7 @@ int main(int argc, char **argv)
if(eps!=0.0)
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
- if (init_nr_ue_signal(UE, 1, 0) != 0) {
+ if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
@@ -654,13 +657,6 @@ int main(int argc, char **argv)
frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
printf("txlev %d (%f)\n",txlev,10*log10(txlev));*/
-
- for (i=0; inb_antennas_tx; aa++) {
- r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
- r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
- }
- }
for (SNR=snr0; SNRnb_antennas_tx; aa++) {
+ r_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
+ r_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
+ }
+ }
+
// multipath channel
//multipath_channel(gNB2UE,s_re,s_im,r_re,r_im,frame_length_complex_samples,0);
@@ -696,13 +700,11 @@ int main(int argc, char **argv)
0.0, // IQ imbalance (dB),
0.0); // IQ phase imbalance (rad)
-
for (i=0; inb_antennas_rx; aa++) {
-
- ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
- ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
- }
+ for (aa=0; aanb_antennas_rx; aa++) {
+ ((short*) UE->common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
+ ((short*) UE->common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
+ }
}
if (n_trials==1) {
@@ -774,6 +776,15 @@ int main(int argc, char **argv)
} // NSR
+ free_channel_desc_scm(gNB2UE);
+
+ phy_free_nr_gNB(gNB);
+ free(RC.gNB[0]);
+ free(RC.gNB);
+
+ term_nr_ue_signal(UE, 1);
+ free(UE);
+
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
@@ -794,6 +805,9 @@ int main(int argc, char **argv)
if (input_fd)
fclose(input_fd);
+ loader_reset();
+ logTerm();
+
return(n_errors);
}
diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c
index fb0f37d7ac..bc4f4a0b60 100644
--- a/openair1/SIMULATION/NR_PHY/prachsim.c
+++ b/openair1/SIMULATION/NR_PHY/prachsim.c
@@ -25,6 +25,7 @@
#include
#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
@@ -72,13 +73,11 @@ openair0_config_t openair0_cfg[MAX_CARDS];
uint64_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
uint16_t sl_ahead = 0;
-msc_interface_t msc_interface;
uint32_t N_RB_DL = 106;
//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
-msc_interface_t msc_interface;
uint64_t get_softmodem_optmask(void) {return 0;}
softmodem_params_t *get_softmodem_params(void) {return 0;}
int oai_nfapi_dl_tti_req(nfapi_nr_dl_tti_request_t *dl_config_req) { return(0); }
@@ -143,7 +142,12 @@ gtpv1u_update_ngu_tunnel(
return 0;
}
-int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
+int gtpv1u_delete_ngu_tunnel( const instance_t instance,
+ gtpv1u_gnb_delete_tunnel_req_t *req) {
return 0;
}
@@ -659,7 +663,6 @@ int main(int argc, char **argv){
RC.nb_nr_L1_inst=1;
phy_init_nr_gNB(gNB,0,1); //lowmem
nr_phy_init_RU(ru);
- gNB->common_vars.rxdata = ru->common.rxdata;
set_tdd_config_nr(&gNB->gNB_config, mu, 7, 6, 2, 4);
// Configure UE
@@ -671,7 +674,7 @@ int main(int argc, char **argv){
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
UE->nrUE_config.prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
- if (init_nr_ue_signal(UE, 1, 0) != 0){
+ if (init_nr_ue_signal(UE, 1) != 0){
printf("Error at UE NR initialisation\n");
exit(-1);
}
@@ -778,7 +781,7 @@ int main(int argc, char **argv){
// multipath channel
// dump_nr_prach_config(&gNB->frame_parms,subframe);
- for (i = 0; i < frame_parms->samples_per_subframe<<1; i++) {
+ for (i = 0; i < frame_parms->samples_per_subframe; i++) {
for (aa=0; aa<1; aa++) {
if (awgn_flag == 0) {
s_re[aa][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]);
@@ -876,7 +879,8 @@ int main(int argc, char **argv){
rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot);
- gNB->prach_vars.rxsigF = ru->prach_rxsigF[prachOccasion];
+ for (int i = 0; i < ru->nb_rx; ++i)
+ gNB->prach_vars.rxsigF[i] = ru->prach_rxsigF[prachOccasion][i];
if (n_frames == 1) printf("ncs %d,num_seq %d\n",prach_pdu->num_cs, prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value);
rx_nr_prach(gNB, prach_pdu, prachOccasion, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay);
@@ -894,7 +898,7 @@ int main(int argc, char **argv){
#ifdef NR_PRACH_DEBUG
LOG_M("prach0.m","prach0", &txdata[0][prach_start], frame_parms->samples_per_subframe, 1, 1);
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1);
- LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
+ LOG_M("rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("ru_rxsigF0.m","rxsF0", ru->common.rxdataF[0], frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot, 1, 1);
LOG_M("ru_prach_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1);
@@ -919,6 +923,28 @@ int main(int argc, char **argv){
break;
} //SNR loop
+ free_channel_desc_scm(UE2gNB);
+
+ nr_phy_free_RU(ru);
+ free(RC.ru[0]);
+ free(RC.ru);
+
+ phy_free_nr_gNB(gNB);
+ // allocated in set_tdd_config_nr()
+ int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<gNB_config.prach_config.num_prach_fd_occasions_list);
+ for (int i = 0; i < nb_slots_to_set; ++i)
+ free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list);
+ free(gNB->gNB_config.tdd_table.max_tdd_periodicity_list);
+ free(RC.gNB[0]);
+ free(RC.gNB);
+
+ term_nr_ue_signal(UE, 1);
+ free(UE->nrUE_config.prach_config.num_prach_fd_occasions_list);
+ free(UE);
+ free(PHY_vars_UE_g[0]);
+ free(PHY_vars_UE_g);
+
for (i=0; i<2; i++) {
free(s_re[i]);
free(s_im[i]);
@@ -933,5 +959,8 @@ int main(int argc, char **argv){
if (input_fd) fclose(input_fd);
+ loader_reset();
+ logTerm();
+
return(0);
}
diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c
index d07469a4b7..151d51d726 100644
--- a/openair1/SIMULATION/NR_PHY/pucchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pucchsim.c
@@ -26,6 +26,7 @@
#include
#include
#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "PHY/types.h"
@@ -70,7 +71,6 @@ int main(int argc, char **argv)
double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0;
double cfo=0;
uint8_t snr1set=0;
- int **txdataF,**rxdataF;
double **s_re,**s_im,**r_re,**r_im;
//int sync_pos, sync_pos_slot;
//FILE *rx_frame_file;
@@ -372,7 +372,7 @@ int main(int argc, char **argv)
printf("Transmitted payload is %ld, do_DTX = %d\n",actual_payload,do_DTX);
- RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
+ RC.gNB = calloc(1, sizeof(PHY_VARS_gNB *));
RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
gNB = RC.gNB[0];
gNB->pucch0_thres = pucch_DTX_thres;
@@ -441,24 +441,15 @@ int main(int argc, char **argv)
s_im = malloc(n_tx*sizeof(double*));
r_re = malloc(n_rx*sizeof(double*));
r_im = malloc(n_rx*sizeof(double*));
- txdataF = malloc(n_tx*sizeof(int*));
- rxdataF = malloc(n_rx*sizeof(int*));
- gNB->common_vars.rxdataF=rxdataF;
memcpy((void*)&gNB->frame_parms,(void*)frame_parms,sizeof(frame_parms));
for (int aatx=0; aatxsymbols_per_slot*frame_parms->ofdm_symbol_size);
- txdataF[aatx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
- bzero(txdataF[aatx],14*frame_parms->ofdm_symbol_size*sizeof(int));
}
for (int aarx=0; aarxsymbols_per_slot*frame_parms->ofdm_symbol_size);
- rxdataF[aarx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
- bzero(rxdataF[aarx],14*frame_parms->ofdm_symbol_size*sizeof(int));
}
uint8_t mcs=0;
@@ -474,7 +465,6 @@ int main(int argc, char **argv)
mcs=table2_mcs[actual_payload+shift];
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag);
}
- else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL);
startingPRB_intraSlotHopping = N_RB_DL-1;
uint32_t hopping_id = Nid_cell;
@@ -490,7 +480,7 @@ int main(int argc, char **argv)
if(eps!=0.0)
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
- if (init_nr_ue_signal(UE, 1, 0) != 0)
+ if (init_nr_ue_signal(UE, 1) != 0)
{
printf("Error at UE NR initialisation\n");
exit(-1);
@@ -536,6 +526,7 @@ int main(int argc, char **argv)
ack_nack_errors=0;
sr_errors=0;
n_errors = 0;
+ int **txdataF = gNB->common_vars.txdataF;
for (trial=0; trialofdm_symbol_size*sizeof(int));
@@ -560,18 +551,17 @@ int main(int argc, char **argv)
if (n_trials==1) printf("txlev %d (%f dB), offset %d, sigma2 %f ( %f dB)\n",txlev,10*log10(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size,sigma2,sigma2_dB);
- int i0;
- double txr,txi,rxr,rxi,nr,ni;
+ struct complex16 **rxdataF = (struct complex16 **)gNB->common_vars.rxdataF;
for (int symb=0; symbframe_parms.symbols_per_slot;symb++) {
if (symb= startingSymbolIndex+nrofSymbols) {
- i0 = symb*gNB->frame_parms.ofdm_symbol_size;
+ int i0 = symb*gNB->frame_parms.ofdm_symbol_size;
for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size);
for (int aarx=0;aarxframe_parms.ofdm_symbol_size;
+ int i0 = (startingSymbolIndex + symb)*gNB->frame_parms.ofdm_symbol_size;
for (int re=0;reframe_parms.first_carrier_offset + re)%gNB->frame_parms.ofdm_symbol_size);
- phasor.r = cos(2*M_PI*phase*re);
+ struct complexd phasor;
+ phasor.r = cos(2*M_PI*phase*re);
phasor.i = sin(2*M_PI*phase*re);
for (int aarx=0;aarxchF[aarx][re].r - txi*UE2gNB->chF[aarx][re].i;
- rxi = txr*UE2gNB->chF[aarx][re].i + txi*UE2gNB->chF[aarx][re].r;
- rxr_tmp = rxr*phasor.r - rxi*phasor.i;
+ double txr = (double)(((int16_t *)txdataF[0])[(i<<1)]);
+ double txi = (double)(((int16_t *)txdataF[0])[1+(i<<1)]);
+ double rxr={0},rxi={0};
+ for (int l = 0; lchannel_length; l++) {
+ rxr = txr*UE2gNB->chF[aarx][l].r - txi*UE2gNB->chF[aarx][l].i;
+ rxi = txr*UE2gNB->chF[aarx][l].i + txi*UE2gNB->chF[aarx][l].r;
+ }
+ double rxr_tmp = rxr*phasor.r - rxi*phasor.i;
rxi = rxr*phasor.i + rxi*phasor.r;
rxr = rxr_tmp;
- nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
- ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
- ((int16_t*)rxdataF[aarx])[i<<1] = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev));
- ((int16_t*)rxdataF[aarx])[1+(i<<1)]=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev));
+ double nr = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
+ double ni = sqrt(sigma2/2)*gaussdouble(0.0,1.0);
+ rxdataF[aarx][i].r = (int16_t)(100.0*(rxr + nr)/sqrt((double)txlev));
+ rxdataF[aarx][i].i=(int16_t)(100.0*(rxi + ni)/sqrt((double)txlev));
if (n_trials==1 && abs(txr) > 0) printf("symb %d, re %d , aarx %d : txr %f, txi %f, chr %f, chi %f, nr %f, ni %f, rxr %f, rxi %f => %d,%d\n",
symb, re, aarx, txr,txi,
UE2gNB->chF[aarx][re].r,UE2gNB->chF[aarx][re].i,
nr,ni, rxr,rxi,
- ((int16_t*)rxdataF[aarx])[i<<1],((int16_t*)rxdataF[aarx])[1+(i<<1)]);
+ rxdataF[aarx][i].r,rxdataF[aarx][i].i);
}
}
}
int rxlev=0;
- for (int aarx=0;aarxofdm_symbol_size],
+ for (int aarx=0;aarxofdm_symbol_size],
frame_parms->ofdm_symbol_size);
int rxlev_pucch=0;
- for (int aarx=0;aarxofdm_symbol_size],
+ for (int aarx=0;aarxofdm_symbol_size],
12);
// set UL mask for pucch allocation
@@ -660,25 +652,26 @@ int main(int argc, char **argv)
if(sr_flag==1){
if (uci_pdu.sr->sr_indication == 0 || uci_pdu.sr->sr_confidence_level == 1)
sr_errors+=1;
+ free(uci_pdu.sr);
}
// harq value 0 -> pass
+ nfapi_nr_harq_t *harq_list = uci_pdu.harq->harq_list;
// confidence value 0 -> good confidence
- const int harq_value0 = uci_pdu.harq->harq_list[0].harq_value;
- const int harq_value1 = uci_pdu.harq->harq_list[1].harq_value;
const int confidence_lvl = uci_pdu.harq->harq_confidence_level;
if(nr_bit>0){
if (nr_bit==1 && do_DTX == 0)
- ack_nack_errors+=(actual_payload^(!harq_value0));
+ ack_nack_errors+=(actual_payload^(!harq_list[0].harq_value));
else if (do_DTX == 0)
- ack_nack_errors+=(((actual_payload&1)^(!harq_value0))+((actual_payload>>1)^(!harq_value1)));
- else if ((!confidence_lvl && !harq_value0) ||
- (!confidence_lvl && nr_bit == 2 && !harq_value1))
+ ack_nack_errors+=(((actual_payload&1)^(!harq_list[0].harq_value))+((actual_payload>>1)^(!harq_list[1].harq_value)));
+ else if ((!confidence_lvl && !harq_list[0].harq_value) ||
+ (!confidence_lvl && nr_bit == 2 && !harq_list[1].harq_value))
ack_nack_errors++;
free(uci_pdu.harq->harq_list);
}
+ free(uci_pdu.harq);
}
else if (format==1) {
- nr_decode_pucch1(rxdataF,PUCCH_GroupHopping,hopping_id,
+ nr_decode_pucch1((int32_t **)rxdataF,PUCCH_GroupHopping,hopping_id,
&(payload_received),frame_parms,amp,nr_slot_tx,
m0,nrofSymbols,startingSymbolIndex,startingPRB,
startingPRB_intraSlotHopping,timeDomainOCC,nr_bit);
@@ -688,8 +681,8 @@ int main(int argc, char **argv)
ack_nack_errors+=((actual_payload^payload_received)&1) + (((actual_payload^payload_received)&2)>>1);
}
else if (format==2) {
- nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu;
- nfapi_nr_pucch_pdu_t pucch_pdu;
+ nfapi_nr_uci_pucch_pdu_format_2_3_4_t uci_pdu={0};
+ nfapi_nr_pucch_pdu_t pucch_pdu={0};
pucch_pdu.rnti = 0x1234;
pucch_pdu.subcarrier_spacing = 1;
pucch_pdu.group_hop_flag = PUCCH_GroupHopping&1;
@@ -734,26 +727,34 @@ int main(int argc, char **argv)
break;
}
}
+ free_channel_desc_scm(UE2gNB);
+ term_freq_channel();
+
+ phy_free_nr_gNB(gNB);
+ free(RC.gNB[0]);
+ free(RC.gNB);
+
+ term_nr_ue_signal(UE, 1);
+ free(UE);
for (int aatx=0; aatx
#include
#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
#include "PHY/types.h"
@@ -372,7 +373,7 @@ int main(int argc, char **argv)
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
- RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
+ RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB));
gNB = RC.gNB[0];
//gNB_config = &gNB->gNB_config;
@@ -400,7 +401,7 @@ int main(int argc, char **argv)
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
//phy_init_nr_top(frame_parms);
- if (init_nr_ue_signal(UE, 1, 0) != 0) {
+ if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation.\n");
exit(-1);
}
@@ -408,7 +409,7 @@ int main(int argc, char **argv)
for (sf = 0; sf < 2; sf++) {
for (i = 0; i < 2; i++) {
- UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0);
+ UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8);
if (!UE->ulsch[sf][0][i]) {
printf("Can't get ue ulsch structures.\n");
@@ -454,46 +455,39 @@ int main(int argc, char **argv)
rel15_ul->pusch_data.tb_size = TBS/8;
///////////////////////////////////////////////////
- double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
- short *channel_output_fixed = malloc16(sizeof(short) * 16 * 68 * 384);
- short *channel_output_uncoded = malloc16(sizeof(unsigned short) * 16 * 68 * 384);
+ double modulated_input[16 * 68 * 384]; // [hna] 16 segments, 68*Zc
+ short channel_output_fixed[16 * 68 * 384];
+ short channel_output_uncoded[16 * 68 * 384];
unsigned int errors_bit_uncoded = 0;
- unsigned char *estimated_output_bit;
- unsigned char *test_input_bit;
unsigned int errors_bit = 0;
- test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
- estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
-
- unsigned char *test_input;
- test_input = (unsigned char *) malloc16(sizeof(unsigned char) * TBS / 8);
-
- for (i = 0; i < TBS / 8; i++)
- test_input[i] = (unsigned char) rand();
+ unsigned char test_input_bit[16 * 68 * 384];
+ unsigned char estimated_output_bit[16 * 68 * 384];
/////////////////////////[adk] preparing UL harq_process parameters/////////////////////////
///////////
NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
+ DevAssert(harq_process_ul_ue);
N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
N_RE_prime = NR_NB_SC_PER_RB*nb_symb_sch - nb_re_dmrs - N_PRB_oh;
- if (harq_process_ul_ue) {
+ harq_process_ul_ue->pusch_pdu.rnti = n_rnti;
+ harq_process_ul_ue->pusch_pdu.mcs_index = Imcs;
+ harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl;
+ harq_process_ul_ue->pusch_pdu.rb_size = nb_rb;
+ harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
+ harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
+ harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
+ harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8;
+ unsigned char *test_input = harq_process_ul_ue->a;
- harq_process_ul_ue->pusch_pdu.rnti = n_rnti;
- harq_process_ul_ue->pusch_pdu.mcs_index = Imcs;
- harq_process_ul_ue->pusch_pdu.nrOfLayers = Nl;
- harq_process_ul_ue->pusch_pdu.rb_size = nb_rb;
- harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
- harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
- harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
- harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8;
- harq_process_ul_ue->a = &test_input[0];
-
- }
///////////
////////////////////////////////////////////////////////////////////////////////////////////
+ for (i = 0; i < TBS / 8; i++)
+ test_input[i] = (unsigned char) rand();
+
#ifdef DEBUG_NR_ULSCHSIM
for (i = 0; i < TBS / 8; i++) printf("test_input[i]=%hhu \n",test_input[i]);
#endif
@@ -620,6 +614,19 @@ int main(int argc, char **argv)
printf("\n");
}
+ for (sf = 0; sf < 2; sf++)
+ for (i = 0; i < 2; i++)
+ free_nr_ue_ulsch(&UE->ulsch[sf][0][i], N_RB_UL);
+ term_nr_ue_signal(UE, 1);
+ free(UE);
+
+ phy_free_nr_gNB(gNB);
+ free(gNB->threadPool);
+ free(gNB->respDecode);
+ free(RC.gNB[0]);
+ free(RC.gNB);
+
+ free_channel_desc_scm(gNB2UE);
if (output_fd)
fclose(output_fd);
@@ -627,6 +634,9 @@ int main(int argc, char **argv)
if (input_fd)
fclose(input_fd);
+ loader_reset();
+ logTerm();
+
return (n_errors);
}
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index c71f52c41a..aebaf42483 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -68,6 +68,12 @@
#include
//#define DEBUG_ULSIM
+const char *__asan_default_options()
+{
+ /* don't do leak checking in nr_ulsim, not finished yet */
+ return "detect_leaks=0";
+}
+
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
@@ -139,7 +145,12 @@ gtpv1u_create_s1u_tunnel(
return 0;
}
-int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+int gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
+int gtpv1u_delete_ngu_tunnel( const instance_t instance,
+ gtpv1u_gnb_delete_tunnel_req_t *req) {
return 0;
}
@@ -720,7 +731,7 @@ int main(int argc, char **argv)
prepare_scd(scd);
- fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0, 0);
+ fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, 0, 1, n_tx, 0, 0, 0, 0);
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
@@ -731,9 +742,9 @@ int main(int argc, char **argv)
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
// common configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,0, 0, NULL);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL);
// UE dedicated configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
frame_parms->nb_antennas_tx = n_tx;
frame_parms->nb_antennas_rx = n_rx;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
@@ -755,28 +766,17 @@ int main(int argc, char **argv)
PHY_vars_UE_g[0][0] = UE;
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
- //phy_init_nr_top(frame_parms);
- if (init_nr_ue_signal(UE, 1, 0) != 0) {
+ if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
- //nr_init_frame_parms_ue(&UE->frame_parms);
- init_nr_ue_transport(UE, 0);
+ init_nr_ue_transport(UE);
- /*
- for (int sf = 0; sf < 2; sf++) {
- for (i = 0; i < 2; i++) {
-
- UE->ulsch[sf][0][i] = new_nr_ue_ulsch(N_RB_UL, 8, 0);
-
- if (!UE->ulsch[sf][0][i]) {
- printf("Can't get ue ulsch structures\n");
- exit(-1);
- }
- }
- }
- */
+ // initialize the pusch dmrs
+ uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell};
+ int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
+ nr_init_pusch_dmrs(UE, N_n_scid, n_scid);
//Configure UE
NR_UE_RRC_INST_t rrcue;
diff --git a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
index f3dbc78a73..4334bd12f9 100644
--- a/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
+++ b/openair1/SIMULATION/NR_UE_PHY/unit_tests/src/pss_util_test.c
@@ -71,7 +71,7 @@ static nfapi_config_request_t *config =&config_t;
/*************** FUNCTIONS ****************************************/
//void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms);
-int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB, uint8_t abstraction_flag);
+int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB);
/*******************************************************************
*
@@ -248,7 +248,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission
//phy_init_nr_top(frame_parms);
- if (init_nr_ue_signal(PHY_vars_UE, 1, 0) != 0) {
+ if (init_nr_ue_signal(PHY_vars_UE, 1) != 0) {
LOG_E(PHY,"Error at UE NR initialisation : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c
index a6b0586882..b1cd691ec4 100644
--- a/openair1/SIMULATION/TOOLS/abstraction.c
+++ b/openair1/SIMULATION/TOOLS/abstraction.c
@@ -33,11 +33,26 @@
// NEW code with lookup table for sin/cos based on delay profile (TO BE TESTED)
double **cos_lut=NULL,* *sin_lut=NULL;
+static int freq_channel_init = 0;
+static int n_samples_max = 0;
//#if 1
-
+void term_freq_channel(void)
+{
+ for (int f = -(n_samples_max >> 1); f <= n_samples_max >> 1; f++) {
+ const int idx = f + (n_samples_max >> 1);
+ if (cos_lut[idx])
+ free_and_zero(cos_lut[idx]);
+ if (sin_lut[idx])
+ free_and_zero(sin_lut[idx]);
+ }
+ free_and_zero(cos_lut);
+ free_and_zero(sin_lut);
+ freq_channel_init = 0;
+ n_samples_max = 0;
+}
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs) {
double delta_f,freq; // 90 kHz spacing
@@ -78,8 +93,6 @@ int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs)
int16_t f,f2,d;
uint8_t aarx,aatx,l;
double *clut,*slut;
- static int freq_channel_init=0;
- static int n_samples_max=0;
// do some error checking
// n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC
diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c
index f09d1a7ce1..0f6b8fb1bc 100644
--- a/openair1/SIMULATION/TOOLS/random_channel.c
+++ b/openair1/SIMULATION/TOOLS/random_channel.c
@@ -125,7 +125,7 @@ void fill_channel_desc(channel_desc_t *chan_desc,
chan_desc->ch[i] = (struct complexd *) malloc(channel_length * sizeof(struct complexd));
for (i = 0; ichF[i] = (struct complexd *) malloc(1200 * sizeof(struct complexd)); // allocate for up to 100 RBs, 12 samples per RB
+ chan_desc->chF[i] = (struct complexd *) malloc(275 * 12 * sizeof(struct complexd)); // allocate for up to 275 RBs, 12 symbols per RB
LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps);
diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h
index ce470fe0b0..f12483d70a 100644
--- a/openair1/SIMULATION/TOOLS/sim.h
+++ b/openair1/SIMULATION/TOOLS/sim.h
@@ -479,6 +479,7 @@ void randominit(unsigned int seed_init);
double uniformrandom(void);
int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples,int scs);
int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples,int scs);
+void term_freq_channel(void);
uint8_t multipath_channel_nosigconv(channel_desc_t *desc);
void multipath_tv_channel(channel_desc_t *desc,
double **tx_sig_re,
diff --git a/openair2/COMMON/gtpv1_u_messages_def.h b/openair2/COMMON/gtpv1_u_messages_def.h
index 2835d07e4a..44e9d4fbdf 100644
--- a/openair2/COMMON/gtpv1_u_messages_def.h
+++ b/openair2/COMMON/gtpv1_u_messages_def.h
@@ -19,18 +19,12 @@
* contact@openairinterface.org
*/
-MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_req_t, Gtpv1uUpdateTunnelReq)
-MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_resp_t, Gtpv1uUpdateTunnelResp)
-MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_req_t, Gtpv1uDeleteTunnelReq)
-MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp)
-MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd)
+
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq)
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
-MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
+MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
-MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
-MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h
index 2dd476ab68..096f0f4697 100644
--- a/openair2/COMMON/gtpv1_u_messages_types.h
+++ b/openair2/COMMON/gtpv1_u_messages_types.h
@@ -28,10 +28,6 @@
#define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity
#define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity
-#define GTPV1U_ENB_UPDATE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelReq
-#define GTPV1U_ENB_UPDATE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelResp
-#define GTPV1U_ENB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelReq
-#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
#define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq
@@ -41,8 +37,6 @@
#define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq
-#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
-#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
@@ -200,7 +194,6 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s {
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
transport_layer_addr_t gnb_addr;
} gtpv1u_gnb_create_tunnel_resp_t;
-
typedef struct gtpv1u_gnb_delete_tunnel_req_s {
rnti_t rnti;
uint8_t num_pdusession;
@@ -212,7 +205,6 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0)
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
} gtpv1u_gnb_delete_tunnel_resp_t;
-
typedef struct gtpv1u_gnb_tunnel_data_req_s {
uint8_t *buffer;
uint32_t length;
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index a08bcf4baf..f4550f63a1 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -55,7 +55,6 @@
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
#include "enb_paramdef.h"
-#include "proto_agent.h"
#include "executables/thread-common.h"
#include
@@ -2080,7 +2079,7 @@ int RCconfig_gtpu(void ) {
GTPV1U_REQ(message).localPort = enb_port_for_S1U;
strcpy(GTPV1U_REQ(message).localAddrStr,address);
sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U);
- itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
+ itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
} else
LOG_E(GTPU,"invalid address for S1U\n");
diff --git a/openair2/F1AP/f1ap_common.h b/openair2/F1AP/f1ap_common.h
index a393930c81..66451530a6 100644
--- a/openair2/F1AP/f1ap_common.h
+++ b/openair2/F1AP/f1ap_common.h
@@ -357,7 +357,6 @@
#include
#include "T.h"
#include "common/ran_context.h"
-#include "msc.h"
/* Checking version of ASN1C compiler */
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c
index 13f08b9458..b3c7363ca4 100644
--- a/openair2/F1AP/f1ap_cu_task.c
+++ b/openair2/F1AP/f1ap_cu_task.c
@@ -35,7 +35,6 @@
#include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_cu_task.h"
-#include "proto_agent.h"
#include
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
@@ -47,7 +46,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", IPaddrs->my_portd);
sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd);
- return ocp_gtpv1Init(tmp);
+ return gtpv1Init(tmp);
}
static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind,
diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c
index ce54e90191..6d4757be6f 100644
--- a/openair2/F1AP/f1ap_du_interface_management.c
+++ b/openair2/F1AP/f1ap_du_interface_management.c
@@ -481,14 +481,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
for (int i=0; i 0, "System Information %d is missing",i);
- MSC_LOG_RX_MESSAGE(
- MSC_F1AP_DU,
- MSC_F1AP_CU,
- 0,
- 0,
- MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d",
- 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- assoc_id);
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message\n");
itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
return 0;
@@ -910,14 +902,6 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate;
- MSC_LOG_RX_MESSAGE(
- MSC_F1AP_DU,
- MSC_F1AP_CU,
- 0,
- 0,
- MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d",
- 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- assoc_id);
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message \n");
itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
return 0;
diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c
index 537f0060ae..c8cfadb999 100644
--- a/openair2/F1AP/f1ap_du_task.c
+++ b/openair2/F1AP/f1ap_du_task.c
@@ -35,7 +35,6 @@
#include "f1ap_du_ue_context_management.h"
#include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_du_task.h"
-#include "proto_agent.h"
#include
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
@@ -103,7 +102,7 @@ static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, c
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
sprintf(tmp.originService, "%d", DUport);
sprintf(tmp.destinationService, "%d", CUport);
- return ocp_gtpv1Init(tmp);
+ return gtpv1Init(tmp);
}
void *F1AP_DU_task(void *arg) {
diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c
index 7d51d95840..821e2def84 100644
--- a/openair2/GNB_APP/gnb_app.c
+++ b/openair2/GNB_APP/gnb_app.c
@@ -31,8 +31,8 @@
#include
#include
#include
+#include
#include
-#include
#include "gnb_app.h"
#include "gnb_config.h"
@@ -135,34 +135,6 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end)
/*------------------------------------------------------------------------------*/
-static void init_pdcp(void) {
- if (!NODE_IS_DU(RC.nrrrc[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;
- if (IS_SOFTMODEM_NOS1) {
- LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n");
- pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
- }
-
- nr_pdcp_module_init(pdcp_initmask, 0);
-
- if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
- LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
- pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req);
- } else {
- LOG_I(PDCP, "node is gNB \n");
- pdcp_set_rlc_data_req_func(rlc_data_req);
- pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
- }
- } else {
- LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
- pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind);
- }
-}
-
-/*------------------------------------------------------------------------------*/
-
void *gNB_app_task(void *args_p)
{
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index db9614b13f..2795c07ce7 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -31,6 +31,7 @@
#include
#include "common/utils/LOG/log.h"
+#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log_extern.h"
#include "assertions.h"
#include "gnb_config.h"
@@ -47,7 +48,6 @@
// #include "SystemInformationBlockType2.h"
// #include "LAYER2/MAC/extern.h"
// #include "LAYER2/MAC/proto.h"
-#include "PHY/phy_extern.h"
#include "PHY/INIT/phy_init.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "nfapi_vnf.h"
@@ -346,9 +346,16 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
// prepare DL Allocation lists
nr_rrc_config_dl_tda(scc);
- if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) {
- free(scc->tdd_UL_DL_ConfigurationCommon->pattern2);
- scc->tdd_UL_DL_ConfigurationCommon->pattern2=NULL;
+ lte_frame_type_t frame_type = get_frame_type((int)*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
+ if (frame_type == FDD) {
+ ASN_STRUCT_FREE(asn_DEF_NR_TDD_UL_DL_ConfigCommon, scc->tdd_UL_DL_ConfigurationCommon);
+ scc->tdd_UL_DL_ConfigurationCommon = NULL;
+ } else { // TDD
+ if (scc->tdd_UL_DL_ConfigurationCommon->pattern2->dl_UL_TransmissionPeriodicity > 320 ) {
+ free(scc->tdd_UL_DL_ConfigurationCommon->pattern2);
+ scc->tdd_UL_DL_ConfigurationCommon->pattern2 = NULL;
+ }
+
}
if ((int)*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing == -1) {
@@ -998,8 +1005,6 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if (num_gnbs>0) {
-
-
// Output a list of all gNBs. ////////// Identification parameters
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
@@ -1155,22 +1160,22 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
(NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l] == 3),"BAD MNC DIGIT LENGTH %d",
NRRRC_CONFIGURATION_REQ (msg_p).mnc_digit_length[l]);
}
- printf("SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr);
+ LOG_I(RRC,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr;
- printf("pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr);
+ LOG_I(RRC,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
- printf("pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
+ LOG_I(RRC,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
- printf("minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr);
+ LOG_I(RRC,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).minRXTXTIME = *GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr;
+ LOG_I(RRC,"SIB1 TDA %d\n",*GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr;
- printf("Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr);
+ LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr;
printf("Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr);
NRRRC_CONFIGURATION_REQ (msg_p).do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr;
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
NRRRC_CONFIGURATION_REQ (msg_p).scd = scd;
-
}//
}//End for (k=0; k configuration.pdsch_AntennaPorts,
rrc->configuration.pusch_AntennaPorts,
rrc->configuration.sib1_tda,
+ rrc->configuration.minRXTXTIME,
rrc->configuration.scc,
NULL,
0,
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index e62978782c..e5b95a7f47 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -34,7 +34,6 @@
#include "assertions.h"
#include "platform_types.h"
-#include "msc.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
@@ -1421,8 +1420,6 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP,
rnti_t rnti) {
unsigned char i;
RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0];
- MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %" PRIx16 " ",
- rnti);
LOG_D(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",
module_idP, CC_id, frameP, rnti);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
index 827d95dba5..6c9ffabd4f 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
@@ -220,6 +220,11 @@ void dlsch_scheduler_pre_ue_select_fairRR(
continue;
}
+
+ if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
+ || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+ continue;
+
if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) {
continue;
}
@@ -335,6 +340,10 @@ void dlsch_scheduler_pre_ue_select_fairRR(
if (rnti == NOT_A_RNTI)
continue;
+ if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
+ || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+ continue;
+
if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) {
continue;
}
@@ -459,6 +468,10 @@ void dlsch_scheduler_pre_ue_select_fairRR(
if (rnti == NOT_A_RNTI)
continue;
+ if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
+ || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+ continue;
+
if(mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED) {
continue;
}
@@ -2241,7 +2254,8 @@ void ulsch_scheduler_pre_ue_select_fairRR(
if (UE_info->UE_template[CC_id][UE_id].configured == FALSE)
continue;
- if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+ if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
+ || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
continue;
// UL DCI
@@ -2403,7 +2417,8 @@ void ulsch_scheduler_pre_ue_select_fairRR(
if (UE_info->UE_template[CC_id][UE_id].configured == FALSE)
continue;
- if (UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+ if (UE_info->UE_sched_ctrl[UE_id].ul_failure_timer > 0
+ || UE_info->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
continue;
if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) {
@@ -2769,13 +2784,12 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 5;
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
} else {
- // assigne RBS( 3 RBs)
-/*
- first_rb[CC_id] = first_rb[CC_id] + 3;
- UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 3;
- UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 2;
+ // assigne RBS( 5 RBs)
+ first_rb[CC_id] = first_rb[CC_id] + 5;
+ UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 5;
+ UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 4;
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
-*/ }
+ }
}
} else if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE ) {
// assigne RBS( 3 RBs)
diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c
index a4e924c68b..fa647454ba 100644
--- a/openair2/LAYER2/MAC/main.c
+++ b/openair2/LAYER2/MAC/main.c
@@ -68,7 +68,7 @@ void *mac_stats_thread(void *param) {
else {
total_bler = (double)UE_scheduling_control->pusch_rx_error_num[CC_id] / (double)(UE_scheduling_control->pusch_rx_error_num[CC_id] + UE_scheduling_control->pusch_rx_num[CC_id]) * 100;
}
- fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d\n",
+ fprintf(fd,"MAC UE rnti %x : %s, PHR %d DLCQI %d PUSCH %d PUCCH %d RLC disc %d UL-stat rcv %lu err %lu bler %lf (%lf/%lf) total_bler %lf mcsoff %d pre_allocated nb_rb %d, mcs %d, bsr %u sched %u tbs %lu cnt %u , DL-stat tbs %lu cnt %u rb %u buf %u 1st %u ret %u ri %d inactivity timer %d\n",
rnti,
UE_scheduling_control->ul_out_of_sync == 0 ? "in synch" : "out of sync",
UE_info->UE_template[CC_id][UE_id].phr_info,
@@ -97,7 +97,8 @@ void *mac_stats_thread(void *param) {
#endif
UE_scheduling_control->first_cnt[CC_id],
UE_scheduling_control->ret_cnt[CC_id],
- UE_scheduling_control->aperiodic_ri_received[CC_id]
+ UE_scheduling_control->aperiodic_ri_received[CC_id],
+ UE_scheduling_control->ul_inactivity_timer
);
fprintf(fd," ULSCH rounds %d/%d/%d/%d, DLSCH rounds %d/%d/%d/%d, ULSCH errors %d, DLSCH errors %d\n",
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0],
@@ -215,7 +216,6 @@ void mac_init_cell_params(int Mod_idP, int CC_idP)
int j;
UE_TEMPLATE *UE_template;
- LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP);
//COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP];
memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS));
diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c
index 1aa959e103..af68cebbe1 100644
--- a/openair2/LAYER2/MAC/ra_procedures.c
+++ b/openair2/LAYER2/MAC/ra_procedures.c
@@ -348,7 +348,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
Size16 = (uint16_t) Size;
// LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size);
LOG_I(RRC,
- "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
+ "[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
frameP, module_idP, eNB_indexP, module_idP);
LOG_I(MAC,
"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
index b07659a0ea..855b6e9822 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c
@@ -51,7 +51,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
uint32_t Ninfo, Np_info, C;
uint8_t n, scale;
- LOG_D(NR_MAC,"nb_symb_sch %d, nb_dmrs_prb %d, nb_rb_oh %d\n",nb_symb_sch,nb_dmrs_prb,nb_rb_oh);
+ LOG_D(NR_MAC, "In %s: nb_symb_sch %d, nb_dmrs_prb %d, nb_rb %d, nb_rb_oh %d, tb_scaling %d Nl %d\n", __FUNCTION__, nb_symb_sch, nb_dmrs_prb, nb_rb, nb_rb_oh, tb_scaling, Nl);
nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
nb_re = min(156, nbp_re) * nb_rb;
@@ -86,7 +86,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
}
}
- LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
+ LOG_D(NR_MAC, "In %s: Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d bits\n", __FUNCTION__, Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
return nr_tbs;
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
index 1c40eae725..b44eb5feb0 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.c
@@ -1725,9 +1725,11 @@ int get_nr_prach_info_from_index(uint8_t index,
subframe = slot >> mu;
s_map = table_6_3_3_2_2_prachConfig_Index[index][4];
if ( (s_map>>subframe)&0x01 ) {
+ *N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe
if (mu == 1) {
- if ( (table_6_3_3_2_2_prachConfig_Index[index][6] <= 1) && (slot%2 == 0) )
+ if ((*N_RA_slot <= 1) && (slot % 2 == 0)){
return 0; // no prach in even slots @ 30kHz for 1 prach per subframe
+ }
}
for(int i = 0; i <= subframe ; i++) {
if ( (s_map >> i) & 0x01) {
@@ -1736,6 +1738,7 @@ int get_nr_prach_info_from_index(uint8_t index,
}
if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){
*start_symbol = table_6_3_3_2_2_prachConfig_Index[index][5];
+ *config_period = x;
*N_t_slot = table_6_3_3_2_2_prachConfig_Index[index][7];
*N_dur = table_6_3_3_2_2_prachConfig_Index[index][8];
if (table_6_3_3_2_2_prachConfig_Index[index][1] != -1)
@@ -2325,11 +2328,6 @@ static inline uint8_t get_table_idx(uint8_t mcs_table, uint8_t dci_format, uint8
}
-/* returns the total DMRS symbols in a slot*/
-uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype){
- return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols, startSymbol, mappingtype));
-}
-
// Table 5.1.2.2.1-1 38.214
uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) {
@@ -2396,7 +2394,14 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
uint8_t row, colomn;
int32_t l_prime;
- LOG_D(NR_MAC, "PUSCH: NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", duration_in_symbols, start_symbol, mapping_type, dmrs_typeA_position);
+ LOG_D(NR_MAC, "In %s: PUSCH NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d additional_pos:%d, pusch_maxLength:%d\n",
+ __FUNCTION__,
+ duration_in_symbols,
+ start_symbol,
+ mapping_type,
+ dmrs_typeA_position,
+ additional_pos,
+ pusch_maxLength);
// Section 6.4.1.1.3 in Spec 38.211
// For PDSCH Mapping TypeA, ld is duration between first OFDM of the slot and last OFDM symbol of the scheduled PUSCH resources
@@ -3105,9 +3110,9 @@ int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, sl
else return(slot_in_period >= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
}
-int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) {
+int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI, int length) {
- int l0;int dmrs_AdditionalPosition = 0;int maxLength = 0;
+ int l0;int dmrs_AdditionalPosition = 0;
NR_DMRS_DownlinkConfig_t *dmrs_config = NULL;
LOG_D(MAC, "NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", NrOfSymbols, startSymbol, mappingtype_fromDCI, dmrs_TypeA_Position);
@@ -3119,7 +3124,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
// in case of DCI FORMAT 1_0 or dedicated pdsch config not received additionposition = pos2, len1 should be used
// referred to section 5.1.6.2 in 38.214
dmrs_AdditionalPosition = 2;
- maxLength = 1;
if (pdsch_Config != NULL) {
if (mappingtype_fromDCI == typeA) { // Type A
@@ -3134,8 +3138,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
AssertFatal(dmrs_config != NULL," DMRS configs not present in PDSCH DMRS Downlink config\n");
- // default values of maxlength = len2, additionalposition is pos2
- if (dmrs_config->maxLength != NULL) maxLength = 2;
+ // default values of additionalposition is pos2
if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition;
}
@@ -3150,11 +3153,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
// For TypeB, ld is the duration of the scheduled PDSCH resources
ld = (mappingtype_fromDCI == typeA) ? (NrOfSymbols + startSymbol) : NrOfSymbols;
- // Section 7.4.1.1.2 in Spec 38.211
- //For PDSCH Mapping typeB, if PDSCH duration ld <=4, only single symbol DMRS is supported
- if (mappingtype_fromDCI == typeB && ld <= 4)
- maxLength = 1;
-
AssertFatal(ld > 2 && ld < 15,"Illegal NrOfSymbols according to Table 5.1.2.1-1 Spec 38.214 %d\n",ld);
AssertFatal((NrOfSymbols + startSymbol) < 15,"Illegal S+L according to Table 5.1.2.1-1 Spec 38.214 S:%d L:%d\n",startSymbol, NrOfSymbols);
@@ -3171,7 +3169,8 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
}
- if (maxLength == 1) {
+ // number of front loaded symbols
+ if (length == 1) {
row = ld - 2;
l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column];
l0 = 1 << l0;
@@ -3182,7 +3181,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
l0 = 1<=0,"ERROR in configuration.Check Time Domain allocation of this Grant. l_prime < 1. row:%d, column:%d\n", row, column);
l_prime = (mappingtype_fromDCI == typeA) ? (l_prime | l0) : (l_prime << startSymbol);
@@ -4169,4 +4168,3 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
}
return valid;
}
-
diff --git a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
index 3c953226f4..2fcf494a15 100644
--- a/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
+++ b/openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h
@@ -41,7 +41,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
-int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI);
+int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI,int length);
int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP);
@@ -184,8 +184,6 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower,
uint8_t NrOfSymbols);
-uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype);
-
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
@param *pusch_config, pointer to pusch config
@param *ubwp pointer to uplink bwp
diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c
index b03c8fa55f..3b10167e03 100644
--- a/openair2/LAYER2/NR_MAC_UE/config_ue.c
+++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c
@@ -38,16 +38,18 @@
#include "common/utils/nr/nr_common.h"
#include "executables/softmodem-common.h"
-int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
- int mu,
- int nrofDownlinkSlots, int nrofDownlinkSymbols,
- int nrofUplinkSlots, int nrofUplinkSymbols) {
+void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
+ int mu,
+ NR_TDD_UL_DL_ConfigCommon_t *tdd_config) {
+ const int nrofDownlinkSlots = tdd_config->pattern1.nrofDownlinkSlots;
+ const int nrofDownlinkSymbols = tdd_config->pattern1.nrofDownlinkSymbols;
+ const int nrofUplinkSlots = tdd_config->pattern1.nrofUplinkSlots;
+ const int nrofUplinkSymbols = tdd_config->pattern1.nrofUplinkSymbols;
int slot_number = 0;
- int nb_periods_per_frame = get_nb_periods_per_frame(cfg->tdd_table.tdd_period);
- int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<pattern1.dl_UL_TransmissionPeriodicity);
+ const int nb_slots_to_set = TDD_CONFIG_NB_FRAMES*(1<tdd_table.tdd_period_in_slots = nb_slots_per_period;
if ( (nrofDownlinkSymbols + nrofUplinkSymbols) == 0 )
@@ -103,7 +105,15 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
}
}
- return (0);
+ if (tdd_config->pattern1.ext1 == NULL) {
+ cfg->tdd_table.tdd_period = tdd_config->pattern1.dl_UL_TransmissionPeriodicity;
+ } else {
+ AssertFatal(tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL, "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
+ cfg->tdd_table.tdd_period = *tdd_config->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
+ }
+
+ LOG_I(NR_MAC, "TDD has been properly configured\n");
+
}
@@ -191,27 +201,10 @@ void config_common_ue_sa(NR_UE_MAC_INST_t *mac,
}
// TDD Table Configuration
- if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
- cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
- else {
- AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
- "scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
- cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
- }
- if(cfg->cell_config.frame_duplex_type == TDD){
- LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period);
- int return_tdd = set_tdd_config_nr_ue(cfg,
- scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols
- );
-
- if (return_tdd !=0)
- LOG_E(PHY,"TDD configuration can not be done\n");
- else
- LOG_I(PHY,"TDD has been properly configurated\n");
+ if (cfg->cell_config.frame_duplex_type == TDD){
+ set_tdd_config_nr_ue(cfg,
+ scc->uplinkConfigCommon->frequencyInfoUL.scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
+ scc->tdd_UL_DL_ConfigurationCommon);
}
// PRACH configuration
@@ -374,31 +367,13 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
}
// TDD Table Configuration
- if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
- cfg->tdd_table.tdd_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
- else {
- AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
- "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
- cfg->tdd_table.tdd_period = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
+ if (cfg->cell_config.frame_duplex_type == TDD){
+ set_tdd_config_nr_ue(cfg,
+ scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
+ scc->tdd_UL_DL_ConfigurationCommon);
}
- if(cfg->cell_config.frame_duplex_type == TDD){
- LOG_I(MAC,"Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period);
- int return_tdd = set_tdd_config_nr_ue(cfg,
- scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots,
- scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols
- );
-
- if (return_tdd !=0)
- LOG_E(PHY,"TDD configuration can not be done\n");
- else
- LOG_I(PHY,"TDD has been properly configurated\n");
- }
-
+
// PRACH configuration
-
uint8_t nb_preambles = 64;
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL)
nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles;
@@ -603,6 +578,7 @@ int nr_rrc_mac_config_req_ue(
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
RA_config_t *ra = &mac->ra;
+ fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
// TODO do something FAPI-like P5 L1/L2 config interface in config_si, config_mib, etc.
@@ -617,11 +593,17 @@ int nr_rrc_mac_config_req_ue(
if (sccP != NULL) {
mac->scc_SIB=sccP;
- LOG_D(MAC,"Keeping ServingCellConfigCommonSIB\n");
+ LOG_D(NR_MAC, "In %s: Keeping ServingCellConfigCommonSIB\n", __FUNCTION__);
config_common_ue_sa(mac,module_id,cc_idP);
- int num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
- if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0) num_slots_ul++;
- LOG_I(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
+
+ int num_slots_ul = nr_slots_per_frame[mac->mib->subCarrierSpacingCommon];
+ if(cfg->cell_config.frame_duplex_type == TDD){
+ num_slots_ul = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+ if (mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) {
+ num_slots_ul++;
+ }
+ }
+ LOG_I(NR_MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
mac->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
for (int i=0; iul_config_request[i].mutex_ul_config), NULL);
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_extern.h b/openair2/LAYER2/NR_MAC_UE/mac_extern.h
index 7fd63666f0..ac837d7798 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_extern.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_extern.h
@@ -57,12 +57,12 @@ extern const uint8_t table_7_3_1_1_2_21[19][4];
extern const uint8_t table_7_3_1_1_2_22[6][5];
extern const uint8_t table_7_3_1_1_2_23[5][6];
extern const uint8_t table_7_3_2_3_3_1[12][5];
-extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6];
+extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10];
extern const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10];
-extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5];
+extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7];
extern const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7];
-extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6];
-extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10];
+extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14];
+extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14];
extern const uint16_t table_7_2_1[16];
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_proto.h b/openair2/LAYER2/NR_MAC_UE/mac_proto.h
index 288716ed85..4158c78b05 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_UE/mac_proto.h
@@ -283,9 +283,9 @@ uint8_t nr_ue_get_sdu(module_id_t module_idP,
uint8_t *ulsch_buffer,
uint16_t buflen);
-int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu,
- int nrofDownlinkSlots, int nrofDownlinkSymbols,
- int nrofUplinkSlots, int nrofUplinkSymbols);
+void set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
+ int mu,
+ NR_TDD_UL_DL_ConfigCommon_t *tdd_config);
void set_harq_status(NR_UE_MAC_INST_t *mac,
uint8_t pucch_id,
diff --git a/openair2/LAYER2/NR_MAC_UE/mac_vars.c b/openair2/LAYER2/NR_MAC_UE/mac_vars.c
index 383267090f..b435dd773f 100644
--- a/openair2/LAYER2/NR_MAC_UE/mac_vars.c
+++ b/openair2/LAYER2/NR_MAC_UE/mac_vars.c
@@ -257,161 +257,161 @@ const uint8_t table_7_3_1_1_2_23[5][6] = {
};
const uint8_t table_7_3_2_3_3_1[12][5] = {
- {1,0,0,0,0},
{1,1,0,0,0},
{1,0,1,0,0},
- {2,0,0,0,0},
+ {1,1,1,0,0},
{2,1,0,0,0},
- {2,2,0,0,0},
- {2,3,0,0,0},
{2,0,1,0,0},
- {2,2,3,0,0},
- {2,0,1,2,0},
- {2,0,1,2,3},
- {2,0,2,0,0}
+ {2,0,0,1,0},
+ {2,0,0,0,1},
+ {2,1,1,0,0},
+ {2,0,0,1,1},
+ {2,1,1,1,0},
+ {2,1,1,1,1},
+ {2,1,0,1,0}
};
-const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6] = {
- {1,0,0,0,0,1},
- {1,1,0,0,0,1},
- {1,0,1,0,0,1},
- {2,0,0,0,0,1},
- {2,1,0,0,0,1},
- {2,2,0,0,0,1},
- {2,3,0,0,0,1},
- {2,0,1,0,0,1},
- {2,2,3,0,0,1},
- {2,0,1,2,0,1},
- {2,0,1,2,3,1},
- {2,0,2,0,0,1},
- {2,0,0,0,0,2},
- {2,1,0,0,0,2},
- {2,2,0,0,0,2},
- {2,3,0,0,0,2},
- {2,4,0,0,0,2},
- {2,5,0,0,0,2},
- {2,6,0,0,0,2},
- {2,7,0,0,0,2},
- {2,0,1,0,0,2},
- {2,2,3,0,0,2},
- {2,4,5,0,0,2},
- {2,6,7,0,0,2},
- {2,0,4,0,0,2},
- {2,2,6,0,0,2},
- {2,0,1,4,0,2},
- {2,2,3,6,0,2},
- {2,0,1,4,5,2},
- {2,2,3,6,7,2},
- {2,0,2,4,6,2}
+const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10] = {
+ {1,1,0,0,0,0,0,0,0,1},
+ {1,0,1,0,0,0,0,0,0,1},
+ {1,1,1,0,0,0,0,0,0,1},
+ {2,1,0,0,0,0,0,0,0,1},
+ {2,0,1,0,0,0,0,0,0,1},
+ {2,0,0,1,0,0,0,0,0,1},
+ {2,0,0,0,1,0,0,0,0,1},
+ {2,1,1,0,0,0,0,0,0,1},
+ {2,0,0,1,1,0,0,0,0,1},
+ {2,1,1,1,0,0,0,0,0,1},
+ {2,1,1,1,1,0,0,0,0,1},
+ {2,1,0,1,0,0,0,0,0,1},
+ {2,1,0,0,0,0,0,0,0,2},
+ {2,0,1,0,0,0,0,0,0,2},
+ {2,0,0,1,0,0,0,0,0,2},
+ {2,0,0,0,1,0,0,0,0,2},
+ {2,0,0,0,0,1,0,0,0,2},
+ {2,0,0,0,0,0,1,0,0,2},
+ {2,0,0,0,0,0,0,1,0,2},
+ {2,0,0,0,0,0,0,0,1,2},
+ {2,1,1,0,0,0,0,0,0,2},
+ {2,0,0,1,1,0,0,0,0,2},
+ {2,0,0,0,0,1,1,0,0,2},
+ {2,0,0,0,0,0,0,1,1,2},
+ {2,1,0,0,0,1,0,0,0,2},
+ {2,0,0,1,0,0,0,1,0,2},
+ {2,1,1,0,0,1,0,0,0,2},
+ {2,0,0,1,1,0,0,1,0,2},
+ {2,1,1,0,0,1,1,0,0,2},
+ {2,0,0,1,1,0,0,1,1,2},
+ {2,1,0,1,0,1,0,1,0,2}
};
const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10] = {
- {2,0,1,2,3,4,0,0,0,2},
- {2,0,1,2,3,4,6,0,0,2},
- {2,0,1,2,3,4,5,6,0,2},
- {2,0,1,2,3,4,5,6,7,2}
+ {2,1,1,1,1,1,0,0,0,2},
+ {2,1,1,1,1,1,0,1,0,2},
+ {2,1,1,1,1,1,1,1,0,2},
+ {2,1,1,1,1,1,1,1,1,2}
};
-const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5] = {
- {1,0,0,0,0},
- {1,1,0,0,0},
- {1,0,1,0,0},
- {2,0,0,0,0},
- {2,1,0,0,0},
- {2,2,0,0,0},
- {2,3,0,0,0},
- {2,0,1,0,0},
- {2,2,3,0,0},
- {2,0,1,2,0},
- {2,0,1,2,3},
- {3,0,0,0,0},
- {3,1,0,0,0},
- {3,2,0,0,0},
- {3,3,0,0,0},
- {3,4,0,0,0},
- {3,5,0,0,0},
- {3,0,1,0,0},
- {3,2,3,0,0},
- {3,4,5,0,0},
- {3,0,1,2,0},
- {3,3,4,5,0},
- {3,0,1,2,3},
- {2,0,2,0,0}
+const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7] = {
+ {1,1,0,0,0,0,0},
+ {1,0,1,0,0,0,0},
+ {1,1,1,0,0,0,0},
+ {2,1,0,0,0,0,0},
+ {2,0,1,0,0,0,0},
+ {2,0,0,1,0,0,0},
+ {2,0,0,0,1,0,0},
+ {2,1,1,0,0,0,0},
+ {2,0,0,1,1,0,0},
+ {2,1,1,1,0,0,0},
+ {2,1,1,1,1,0,0},
+ {3,1,0,0,0,0,0},
+ {3,0,1,0,0,0,0},
+ {3,0,0,1,0,0,0},
+ {3,0,0,0,1,0,0},
+ {3,0,0,0,0,1,0},
+ {3,0,0,0,0,0,1},
+ {3,1,1,0,0,0,0},
+ {3,0,0,1,1,0,0},
+ {3,0,0,0,0,1,1},
+ {3,1,1,1,0,0,0},
+ {3,0,0,0,1,1,1},
+ {3,1,1,1,1,0,0},
+ {3,1,0,1,0,0,0}
};
const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7] = {
- {3,0,1,2,3,4,0},
- {3,0,1,2,3,4,5}
+ {3,1,1,1,1,1,0},
+ {3,1,1,1,1,1,1}
};
-const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6] = {
- {1,0,0,0,0,1},
- {1,1,0,0,0,1},
- {1,0,1,0,0,1},
- {2,0,0,0,0,1},
- {2,1,0,0,0,1},
- {2,2,0,0,0,1},
- {2,3,0,0,0,1},
- {2,0,1,0,0,1},
- {2,2,3,0,0,1},
- {2,0,1,2,0,1},
- {2,0,1,2,3,1},
- {3,0,0,0,0,1},
- {3,1,0,0,0,1},
- {3,2,0,0,0,1},
- {3,3,0,0,0,1},
- {3,4,0,0,0,1},
- {3,5,0,0,0,1},
- {3,0,1,0,0,1},
- {3,2,3,0,0,1},
- {3,4,5,0,0,1},
- {3,0,1,2,0,1},
- {3,3,4,5,0,1},
- {3,0,1,2,3,1},
- {2,0,2,0,0,1},
- {3,0,0,0,0,2},
- {3,1,0,0,0,2},
- {3,2,0,0,0,2},
- {3,3,0,0,0,2},
- {3,4,0,0,0,2},
- {3,5,0,0,0,2},
- {3,6,0,0,0,2},
- {3,7,0,0,0,2},
- {3,8,0,0,0,2},
- {3,9,0,0,0,2},
- {3,10,0,0,0,2},
- {3,11,0,0,0,2},
- {3,0,1,0,0,2},
- {3,2,3,0,0,2},
- {3,4,5,0,0,2},
- {3,6,7,0,0,2},
- {3,8,9,0,0,2},
- {3,10,11,0,0,2},
- {3,0,1,6,0,2},
- {3,2,3,8,0,2},
- {3,4,5,10,0,2},
- {3,0,1,6,7,2},
- {3,2,3,8,9,2},
- {3,4,5,10,11,2},
- {1,0,0,0,0,2},
- {1,1,0,0,0,2},
- {1,6,0,0,0,2},
- {1,7,0,0,0,2},
- {1,0,1,0,0,2},
- {1,6,7,0,0,2},
- {2,0,1,0,0,2},
- {2,2,3,0,0,2},
- {2,6,7,0,0,2},
- {2,8,9,0,0,2}
+const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14] = {
+ {1,1,0,0,0,0,0,0,0,0,0,0,0,1},
+ {1,0,1,0,0,0,0,0,0,0,0,0,0,1},
+ {1,1,1,0,0,0,0,0,0,0,0,0,0,1},
+ {2,1,0,0,0,0,0,0,0,0,0,0,0,1},
+ {2,0,1,0,0,0,0,0,0,0,0,0,0,1},
+ {2,0,0,1,0,0,0,0,0,0,0,0,0,1},
+ {2,0,0,0,1,0,0,0,0,0,0,0,0,1},
+ {2,1,1,0,0,0,0,0,0,0,0,0,0,1},
+ {2,0,0,1,1,0,0,0,0,0,0,0,0,1},
+ {2,1,1,1,0,0,0,0,0,0,0,0,0,1},
+ {2,1,1,1,1,0,0,0,0,0,0,0,0,1},
+ {3,1,0,0,0,0,0,0,0,0,0,0,0,1},
+ {3,0,1,0,0,0,0,0,0,0,0,0,0,1},
+ {3,0,0,1,0,0,0,0,0,0,0,0,0,1},
+ {3,0,0,0,1,0,0,0,0,0,0,0,0,1},
+ {3,0,0,0,0,1,0,0,0,0,0,0,0,1},
+ {3,0,0,0,0,0,1,0,0,0,0,0,0,1},
+ {3,1,1,0,0,0,0,0,0,0,0,0,0,1},
+ {3,0,0,1,1,0,0,0,0,0,0,0,0,1},
+ {3,0,0,0,0,1,1,0,0,0,0,0,0,1},
+ {3,1,1,1,0,0,0,0,0,0,0,0,0,1},
+ {3,0,0,0,1,1,1,0,0,0,0,0,0,1},
+ {3,1,1,1,1,0,0,0,0,0,0,0,0,1},
+ {2,1,0,1,0,0,0,0,0,0,0,0,0,1},
+ {3,1,0,0,0,0,0,0,0,0,0,0,0,2},
+ {3,0,1,0,0,0,0,0,0,0,0,0,0,2},
+ {3,0,0,1,0,0,0,0,0,0,0,0,0,2},
+ {3,0,0,0,1,0,0,0,0,0,0,0,0,2},
+ {3,0,0,0,0,1,0,0,0,0,0,0,0,2},
+ {3,0,0,0,0,0,1,0,0,0,0,0,0,2},
+ {3,0,0,0,0,0,0,1,0,0,0,0,0,2},
+ {3,0,0,0,0,0,0,0,1,0,0,0,0,2},
+ {3,0,0,0,0,0,0,0,0,1,0,0,0,2},
+ {3,0,0,0,0,0,0,0,0,0,1,0,0,2},
+ {3,0,0,0,0,0,0,0,0,0,0,1,0,2},
+ {3,0,0,0,0,0,0,0,0,0,0,0,1,2},
+ {3,1,1,0,0,0,0,0,0,0,0,0,0,2},
+ {3,0,0,1,1,0,0,0,0,0,0,0,0,2},
+ {3,0,0,0,0,1,1,0,0,0,0,0,0,2},
+ {3,0,0,0,0,0,0,1,1,0,0,0,0,2},
+ {3,0,0,0,0,0,0,0,0,1,1,0,0,2},
+ {3,0,0,0,0,0,0,0,0,0,0,1,1,2},
+ {3,1,1,0,0,0,0,1,0,0,0,0,0,2},
+ {3,0,0,1,1,0,0,0,0,1,0,0,0,2},
+ {3,0,0,0,0,1,1,0,0,0,0,1,0,2},
+ {3,1,1,0,0,0,0,1,1,0,0,0,0,2},
+ {3,0,0,1,1,0,0,0,0,1,1,0,0,2},
+ {3,0,0,0,0,1,1,0,0,0,0,1,1,2},
+ {1,1,0,0,0,0,0,0,0,0,0,0,0,2},
+ {1,0,1,0,0,0,0,0,0,0,0,0,0,2},
+ {1,0,0,0,0,0,0,1,0,0,0,0,0,2},
+ {1,0,0,0,0,0,0,0,1,0,0,0,0,2},
+ {1,1,1,0,0,0,0,0,0,0,0,0,0,2},
+ {1,0,0,0,0,0,0,1,1,0,0,0,0,2},
+ {2,1,1,0,0,0,0,0,0,0,0,0,0,2},
+ {2,0,0,1,1,0,0,0,0,0,0,0,0,2},
+ {2,0,0,0,0,0,0,1,1,0,0,0,0,2},
+ {2,0,0,0,0,0,0,0,0,1,1,0,0,2}
};
-const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10] = {
- {3,0,1,2,3,4,0,0,0,1},
- {3,0,1,2,3,4,5,0,0,1},
- {2,0,1,2,3,6,0,0,0,2},
- {2,0,1,2,3,6,8,0,0,2},
- {2,0,1,2,3,6,7,8,0,2},
- {2,0,1,2,3,6,7,8,9,2}
+const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14] = {
+ {3,1,1,1,1,1,0,0,0,0,0,0,0,1},
+ {3,1,1,1,1,1,1,0,0,0,0,0,0,1},
+ {2,1,1,1,1,0,0,1,0,0,0,0,0,2},
+ {2,1,1,1,1,0,0,1,0,1,0,0,0,2},
+ {2,1,1,1,1,0,0,1,1,1,0,0,0,2},
+ {2,1,1,1,1,0,0,1,1,1,1,0,0,2},
};
// table 7.2-1 TS 38.321
diff --git a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
index 73b5a35b62..4adee2bced 100644
--- a/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+++ b/openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
@@ -70,10 +70,12 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
// point to a list of structures (one for each UL slot) to store PUSCH scheduling parameters
// received from UL DCI.
if (nr_ue_mac_inst->scc) {
- int num_slots_ul = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
- if (nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols>0)
+ NR_TDD_UL_DL_ConfigCommon_t *tdd = nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon;
+ int num_slots_ul = tdd ? tdd->pattern1.nrofUplinkSlots : nr_slots_per_frame[*nr_ue_mac_inst->scc->ssbSubcarrierSpacing];
+ if (tdd && nr_ue_mac_inst->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0) {
num_slots_ul++;
- LOG_D(MAC, "Initializing ul_config_request. num_slots_ul = %d\n", num_slots_ul);
+ }
+ LOG_D(NR_MAC, "In %s: Initializing ul_config_request. num_slots_ul = %d\n", __FUNCTION__, num_slots_ul);
nr_ue_mac_inst->ul_config_request = (fapi_nr_ul_config_request_t *)calloc(num_slots_ul, sizeof(fapi_nr_ul_config_request_t));
for (int i=0; iul_config_request[i].mutex_ul_config), NULL);
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c
index eaaa5f5f72..2d704b5c81 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_l1_helpers.c
@@ -38,7 +38,6 @@
#include "LAYER2/NR_MAC_UE/nr_l1_helpers.h"
#include "NR_P-Max.h"
-
// Implementation of 6.2.4 Configured ransmitted power
// 3GPP TS 38.101-1 version 16.5.0 Release 16
// -
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
index 0ab103aaa7..a641c1e456 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
@@ -871,14 +871,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
(get_softmodem_params()->nsa) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position,
dlsch_config_pdu_1_0->number_symbols,
dlsch_config_pdu_1_0->start_symbol,
- mappingtype);
+ mappingtype, 1);
dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ?
(mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
+
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
if (dlsch_config_pdu_1_0->number_symbols == 2)
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
else
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2;
+ dlsch_config_pdu_1_0->dmrs_ports = 1; // only port 0 in case of DCI 1_0
/* VRB_TO_PRB_MAPPING */
dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved;
/* MCS TABLE INDEX */
@@ -1075,13 +1077,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB);
- /* dmrs symbol positions*/
- dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config,
- mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position,
- dlsch_config_pdu_1_1->number_symbols,
- dlsch_config_pdu_1_1->start_symbol,
- mappingtype);
-
dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
@@ -1145,6 +1140,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
uint8_t n_codewords = 1; // FIXME!!!
long *max_length = NULL;
long *dmrs_type = NULL;
+ dlsch_config_pdu_1_1->n_front_load_symb = 1; // default value
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA) {
max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength;
dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type;
@@ -1156,31 +1152,35 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
if ((dmrs_type == NULL) && (max_length == NULL)){
// Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_1[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_1[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_1[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_1[dci->antenna_ports.val][4];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_1[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3));
}
if ((dmrs_type == NULL) && (max_length != NULL)){
// Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2
if (n_codewords == 1) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4];
- dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][7]<<6) +
+ (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][8]<<7));
+ dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][9];
}
if (n_codewords == 2) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4];
- dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5];
- dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6];
- dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7];
- dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]<<6) +
+ (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]<<7));
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][9];
}
}
@@ -1188,44 +1188,67 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
// Table 7.3.1.2.2-3: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=1
if (n_codewords == 1) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5));
}
if (n_codewords == 2) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4];
- dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5];
- dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5));
}
}
if ((dmrs_type != NULL) && (max_length != NULL)){
// Table 7.3.1.2.2-4: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=2
if (n_codewords == 1) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4];
- dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][7]<<6) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][8]<<7) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][9]<<8) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][10]<<9) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][11]<<10) +
+ (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][12]<<11));
+ dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][13];
}
if (n_codewords == 2) {
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0];
- dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1];
- dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2];
- dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3];
- dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4];
- dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5];
- dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6];
- dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7];
- dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8];
+ dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]<<2) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]<<6) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]<<7) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]<<8) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][10]<<9) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][11]<<10) +
+ (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][12]<<11));
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9];
}
}
+
+ /* dmrs symbol positions*/
+ dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config,
+ mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position,
+ dlsch_config_pdu_1_1->number_symbols,
+ dlsch_config_pdu_1_1->start_symbol,
+ mappingtype,
+ dlsch_config_pdu_1_1->n_front_load_symb);
+
/* TCI */
if (mac->dl_config_request.dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.tci_present_in_dci == 1){
// 0 bit if higher layer parameter tci-PresentInDCI is not enabled
@@ -1259,7 +1282,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
feedback_ti,
dci->dai[0].val,
dci_ind->n_CCE,dci_ind->N_CCE,
- 0, frame,slot);
+ 0,frame,slot);
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_DLSCH;
LOG_D(MAC,"(nr_ue_procedures.c) pdu_type=%d\n\n",dl_config->dl_config_list[dl_config->number_pdus].pdu_type);
@@ -3833,6 +3856,21 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
LOG_A(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID);
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
ra->RA_RAPID_found = 1;
+ if (get_softmodem_params()->emulate_l1) {
+ /* When we are emulating L1 with multiple UEs, the rx_indication will have
+ multiple RAR PDUs. The code would previously handle each of these PDUs,
+ but it should only be handling the single RAR that matches the current
+ UE. */
+ LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id);
+ dl_info->rx_ind->number_pdus = 1;
+ if (pdu_id != 0) {
+ memcpy(&dl_info->rx_ind->rx_indication_body[0],
+ &dl_info->rx_ind->rx_indication_body[pdu_id],
+ sizeof(fapi_nr_rx_indication_body_t));
+ }
+ mac->nr_ue_emul_l1.expected_rar = false;
+ memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
+ }
break;
}
if (rarh->E == 0) {
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
index 44bd8f0ce3..1a2e52a603 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
@@ -166,12 +166,14 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl
int mu = mac->ULbwp[0] ?
mac->ULbwp[0]->bwp_Common->genericParameters.subcarrierSpacing :
mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.subcarrierSpacing;
- NR_TDD_UL_DL_Pattern_t *tdd_pattern = &tdd_config->pattern1;
- const int num_slots_per_tdd = nr_slots_per_frame[mu] >> (7 - tdd_pattern->dl_UL_TransmissionPeriodicity);
- const int num_slots_ul = tdd_pattern->nrofUplinkSlots + (tdd_pattern->nrofUplinkSymbols!=0);
+ const int n = nr_slots_per_frame[mu];
+ const int num_slots_per_tdd = tdd_config ? (n >> (7 - tdd_config->pattern1.dl_UL_TransmissionPeriodicity)) : n;
+ const int num_slots_ul = tdd_config ? (tdd_config->pattern1.nrofUplinkSlots + (tdd_config->pattern1.nrofUplinkSymbols != 0)) : n;
int index = slot % num_slots_ul;
- LOG_D(NR_MAC, "In %s slots per tdd %d, num_slots_ul %d, index %d\n", __FUNCTION__,
+ LOG_D(NR_MAC, "In %s slots per %s: %d, num_slots_ul %d, index %d\n",
+ __FUNCTION__,
+ tdd_config ? "TDD" : "FDD",
num_slots_per_tdd,
num_slots_ul,
index);
@@ -632,7 +634,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
pusch_config_pdu->nr_of_symbols = NrOfSymbols;
l_prime_mask = get_l_prime(NrOfSymbols, mappingtype, add_pos, dmrslength, StartSymbolIndex, mac->scc ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position);
- LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask);
+ LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, DMRS_MASK:%x\n", pusch_config_pdu->start_symbol_index, pusch_config_pdu->nr_of_symbols, mappingtype, l_prime_mask);
#ifdef DEBUG_MSG3
LOG_D(NR_MAC, "In %s BWP assignment (BWP (start %d, size %d) \n", __FUNCTION__, pusch_config_pdu->bwp_start, pusch_config_pdu->bwp_size);
@@ -1571,7 +1573,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac,
// Calculate TX slot and frame
*slot_tx = (current_slot + k2) % nr_slots_per_frame[mu];
- *frame_tx = ((current_slot + k2) > nr_slots_per_frame[mu]) ? (current_frame + 1) % 1024 : current_frame;
+ *frame_tx = ((current_slot + k2) > (nr_slots_per_frame[mu]-1)) ? (current_frame + 1) % 1024 : current_frame;
}
@@ -2260,8 +2262,7 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
}
// CSI
- if (mac->ra.ra_state == RA_SUCCEEDED ||
- get_softmodem_params()->phy_test == 1)
+ if (mac->ra.ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test == 1)
O_CSI = nr_get_csi_measurements(mac, frameP, slotP, pucch);
// ACKNACK
diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c
index 7b89e4e993..e703d5aa65 100644
--- a/openair2/LAYER2/NR_MAC_gNB/config.c
+++ b/openair2/LAYER2/NR_MAC_gNB/config.c
@@ -58,6 +58,7 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
NR_UE_sched_ctrl_t *sched_ctrl) {
+
if (rlc_bearer2add_list)
// keep lcids
for (int i=0;ilist.count;i++) {
@@ -135,6 +136,7 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche
process_rlcBearerConfig(CellGroup->rlc_BearerToAddModList,CellGroup->rlc_BearerToReleaseList,sched_ctrl);
}
+
void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
@@ -363,8 +365,9 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
cfg->num_tlv+=2;
+ // logical antenna ports
cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts;
- AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 13, "pdsch_AntennaPorts in 1...12\n");
+ AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 33, "pdsch_AntennaPorts in 1...32\n");
cfg->carrier_config.num_tx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_TX_ANT_TAG;
int num_ssb=0;
@@ -394,18 +397,17 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
cfg->num_tlv++;
// TDD Table Configuration
- //cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
- cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG;
- cfg->num_tlv++;
- if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL)
- cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
- else {
- AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
- "scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n");
- cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
- }
- if(cfg->cell_config.frame_duplex_type.value == TDD){
- LOG_I(NR_MAC,"Setting TDD configuration period to %d\n",cfg->tdd_table.tdd_period.value);
+ if (cfg->cell_config.frame_duplex_type.value == TDD){
+ cfg->tdd_table.tdd_period.tl.tag = NFAPI_NR_CONFIG_TDD_PERIOD_TAG;
+ cfg->num_tlv++;
+ if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1 == NULL) {
+ cfg->tdd_table.tdd_period.value = scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity;
+ } else {
+ AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 != NULL,
+ "In %s: scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530 is null\n", __FUNCTION__);
+ cfg->tdd_table.tdd_period.value = *scc->tdd_UL_DL_ConfigurationCommon->pattern1.ext1->dl_UL_TransmissionPeriodicity_v1530;
+ }
+ LOG_I(NR_MAC, "Setting TDD configuration period to %d\n", cfg->tdd_table.tdd_period.value);
int periods_per_frame = set_tdd_config_nr(cfg,
scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing,
scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots,
@@ -423,12 +425,13 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
}
-extern uint16_t sl_ahead;
+
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int ssb_SubcarrierOffset,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int sib1_tda,
+ int minRXTXTIMEpdsch,
NR_ServingCellConfigCommon_t *scc,
NR_BCCH_BCH_Message_t *mib,
int add_ue,
@@ -439,24 +442,21 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
AssertFatal((scc->ssb_PositionsInBurst->present > 0) && (scc->ssb_PositionsInBurst->present < 4), "SSB Bitmap type %d is not valid\n",scc->ssb_PositionsInBurst->present);
/* dimension UL_tti_req_ahead for number of slots in frame */
- const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160};
- const int n = slots_per_frame[*scc->ssbSubcarrierSpacing];
+ const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
RC.nrmac[Mod_idP]->UL_tti_req_ahead[0] = calloc(n, sizeof(nfapi_nr_ul_tti_request_t));
AssertFatal(RC.nrmac[Mod_idP]->UL_tti_req_ahead[0],
"could not allocate memory for RC.nrmac[]->UL_tti_req_ahead[]\n");
- /* fill in slot/frame numbers: slot is fixed, frame will be updated by
- * scheduler */
+ /* fill in slot/frame numbers: slot is fixed, frame will be updated by scheduler
+ extern sf_ahead is initialized in ru_thread but that function is not executed yet here*/
+ const uint16_t sf_ahead = (uint16_t) ceil((float)6/(0x01<<(*scc->ssbSubcarrierSpacing)));
+ const uint16_t sl_ahead = sf_ahead * (0x01<<(*scc->ssbSubcarrierSpacing));
+ /* consider that scheduler runs sl_ahead: the first sl_ahead slots are
+ * already "in the past" and thus we put frame 1 instead of 0!*/
for (int i = 0; i < n; ++i) {
nfapi_nr_ul_tti_request_t *req = &RC.nrmac[Mod_idP]->UL_tti_req_ahead[0][i];
- /* consider that scheduler runs sl_ahead: the first sl_ahead slots are
- * already "in the past" and thus we put frame 1 instead of 0! Note that
- * variable sl_ahead seems to not be correctly initialized, but I leave
- * it for information purposes here (the fix would always put 0, what
- * happens now, too) */
- req->SFN = i < sl_ahead;
+ req->SFN = i < (sl_ahead-1);
req->Slot = i;
}
-
RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL =
calloc(n * MAX_BWP_SIZE, sizeof(uint16_t));
AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].vrb_map_UL,
@@ -480,6 +480,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
}
}
RC.nrmac[Mod_idP]->ssb_SubcarrierOffset = ssb_SubcarrierOffset;
+ RC.nrmac[Mod_idP]->minRXTXTIMEpdsch = minRXTXTIMEpdsch;
NR_PHY_Config_t phycfg;
phycfg.Mod_id = Mod_idP;
@@ -490,19 +491,31 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
find_SSB_and_RO_available(Mod_idP);
- const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
- const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
- const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
- const int nr_dlmix_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0);
- const int nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0);
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+
+ int nr_slots_period = n;
+ int nr_dl_slots = n;
+ int nr_ulstart_slot = 0;
+ if (tdd) {
+ nr_dl_slots = tdd->nrofDownlinkSlots + (tdd->nrofDownlinkSymbols != 0);
+ nr_ulstart_slot = tdd->nrofDownlinkSlots + (tdd->nrofUplinkSymbols == 0);
+ nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ }
+ else
+ // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration
+ AssertFatal(RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD,"Dynamic TDD not handled yet\n");
for (int slot = 0; slot < n; ++slot) {
/* FIXME: it seems there is a problem with slot 0/10/slots right after UL:
- * we just get retransmissions. Thus, do not schedule such slots in DL */
- if (slot % nr_slots_period != 0)
- RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dlmix_slots) << (slot % 64);
+ * we just get retransmissions. Thus, do not schedule such slots in DL in TDD */
+ if (RC.nrmac[Mod_idP]->common_channels[0].frame_type == FDD ||
+ (slot % nr_slots_period != 0)){
+ RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) < nr_dl_slots) << (slot % 64);
+ }
RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] |= (uint64_t)((slot % nr_slots_period) >= nr_ulstart_slot) << (slot % 64);
- LOG_D(NR_MAC, "slot %d DL %d UL %d\n",
+
+ LOG_I(NR_MAC, "In %s: slot %d DL %d UL %d\n",
+ __FUNCTION__,
slot,
(RC.nrmac[Mod_idP]->dlsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0,
(RC.nrmac[Mod_idP]->ulsch_slot_bitmap[slot / 64] & ((uint64_t)1 << (slot % 64))) != 0);
@@ -615,16 +628,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
- if (sched_ctrl->available_dl_harq.len == 0) {
+ if (get_softmodem_params()->sa) {
// add all available DL HARQ processes for this UE in SA
create_dl_harq_list(sched_ctrl, pdsch);
}
- else {
- const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
- get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
- AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ,
- "Reconfiguration of available harq processes not yet supported\n");
- }
// update coreset/searchspace
void *bwpd = NULL;
NR_BWP_t *genericParameters = NULL;
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
index ba854608c5..51541353f4 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
@@ -36,6 +36,7 @@
#include "NR_MAC_gNB/mac_proto.h"
#include "common/utils/LOG/log.h"
+#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "OCG.h"
@@ -89,7 +90,7 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
/* advance last round's future UL_tti_req to be ahead of current frame/slot */
future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024;
- LOG_D(MAC,"Future_ul_tti SFN = %d for slot %d \n", future_ul_tti_req->SFN, (slotP + num_slots - 1) % num_slots);
+ LOG_D(NR_MAC, "In %s: UL_tti_req_ahead SFN.slot = %d.%d for slot %d \n", __FUNCTION__, future_ul_tti_req->SFN, future_ul_tti_req->Slot, (slotP + num_slots - 1) % num_slots);
/* future_ul_tti_req->Slot is fixed! */
future_ul_tti_req->n_pdus = 0;
future_ul_tti_req->n_ulsch = 0;
@@ -284,12 +285,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
if (slot==0 && (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]>=257)) {
+ //FR2
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
- const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
- const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
- const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
- const int nb_periods_per_frame = n / nr_slots_period;
- // re-initialization of tdd_beam_association at beginning of frame (only for FR2)
+ AssertFatal(tdd,"Dynamic TDD not handled yet\n");
+ const int nb_periods_per_frame = get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ // re-initialization of tdd_beam_association at beginning of frame
for (int i=0; itdd_beam_association[i] = -1;
}
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
index 44b65a5387..d35ef97941 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
@@ -397,6 +397,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot,
uint16_t *msg2_frame, uint16_t *msg2_slot,
NR_ServingCellConfigCommon_t *scc,
+ lte_frame_type_t frame_type,
uint16_t monitoring_slot_period,
uint16_t monitoring_offset,uint8_t beam_index,
uint8_t num_active_ssb,
@@ -404,18 +405,25 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot,
// preferentially we schedule the msg2 in the mixed slot or in the last dl slot
// if they are allowed by search space configuration
-
uint8_t mu = *scc->ssbSubcarrierSpacing;
uint8_t response_window = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.ra_ResponseWindow;
uint8_t slot_window;
+ const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
// number of mixed slot or of last dl slot if there is no mixed slot
- uint8_t last_dl_slot_period = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots;
+ uint8_t last_dl_slot_period = n_slots_frame-1;
// lenght of tdd period in slots
- uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
- if (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols == 0)
- last_dl_slot_period--;
- if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))
- tdd_period_slot++;
+ uint8_t tdd_period_slot = n_slots_frame;
+
+ if (tdd) {
+ last_dl_slot_period = tdd->nrofDownlinkSymbols == 0? (tdd->nrofDownlinkSlots-1) : tdd->nrofDownlinkSlots;
+ tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ }
+ else{
+ if(frame_type == TDD)
+ AssertFatal(frame_type == FDD, "Dynamic TDD not handled yet\n");
+ }
+
switch(response_window){
case NR_RACH_ConfigGeneric__ra_ResponseWindow_sl1:
@@ -449,7 +457,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot,
// slot and frame limit to transmit msg2 according to response window
uint8_t slot_limit = (rach_slot + slot_window)%nr_slots_per_frame[mu];
- uint8_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1);
+ uint16_t frame_limit = (slot_limit>(rach_slot))? rach_frame : (rach_frame +1);
// computing start of next period
@@ -478,9 +486,21 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot,
// go to previous slot if the current scheduled slot is beyond the response window
// and if the slot is not among the PDCCH monitored ones (38.213 10.1)
- while (((*msg2_slot>slot_limit)&&(*msg2_frame>frame_limit)) || ((*msg2_frame*nr_slots_per_frame[mu]+*msg2_slot-monitoring_offset)%monitoring_slot_period !=0)) {
- if((*msg2_slot%tdd_period_slot) > 0)
- (*msg2_slot)--;
+ while (*msg2_frame > frame_limit
+ || (*msg2_frame == frame_limit && *msg2_slot > slot_limit)
+ || ((*msg2_frame * nr_slots_per_frame[mu] + *msg2_slot - monitoring_offset) % monitoring_slot_period != 0)) {
+
+ if((frame_type == FDD) || ((*msg2_slot%tdd_period_slot) > 0)) {
+ if (*msg2_slot==0) {
+ if(*msg2_frame != 0)
+ (*msg2_frame)--;
+ else
+ *msg2_frame = 1023;
+ *msg2_slot = nr_slots_per_frame[mu] - 1;
+ }
+ else
+ (*msg2_slot)--;
+ }
else
AssertFatal(1==0,"No available DL slot to schedule msg2 has been found");
}
@@ -503,6 +523,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = &nr_mac->common_channels[CC_id];
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
+ lte_frame_type_t frame_type = cc->frame_type;
uint8_t total_RApreambles = MAX_NUM_NR_PRACH_PREAMBLES;
uint8_t num_ssb_per_RO = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present;
@@ -624,6 +645,7 @@ void nr_initiate_ra_proc(module_id_t module_idP,
&msg2_frame,
&msg2_slot,
scc,
+ frame_type,
monitoring_slot_period,
monitoring_offset,
beam_index,
@@ -734,10 +756,13 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
// beam association for FR2
int16_t *tdd_beam_association = nr_mac->tdd_beam_association;
if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) {
- uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
- if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))
- tdd_period_slot++;
+ // FR2
+ const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+ AssertFatal(tdd,"Dynamic TDD not handled yet\n");
+ uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
int num_tdd_period = sched_slot/tdd_period_slot;
+
if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id))
return; // can't schedule retransmission in this slot
else
@@ -898,6 +923,8 @@ void nr_get_Msg3alloc(module_id_t module_id,
uint16_t msg3_nb_rb = 8; // sdu has 6 or 8 bytes
+ lte_frame_type_t frame_type = RC.nrmac[module_id]->common_channels->frame_type;
+
int mu = ubwp ?
ubwp->bwp_Common->genericParameters.subcarrierSpacing :
scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
@@ -908,8 +935,9 @@ void nr_get_Msg3alloc(module_id_t module_id,
ubwp->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList:
scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+ const int n_slots_frame = nr_slots_per_frame[mu];
uint8_t k2 = 0;
- lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
if (frame_type == TDD) {
int nb_periods_per_frame = get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
int nb_slots_per_period = ((1<Msg3_tda_id<16,"Unable to find Msg3 time domain allocation in list\n");
- if (nr_slots_per_frame[mu]>temp_slot)
+ if (n_slots_frame > temp_slot)
ra->Msg3_frame = current_frame;
else
- ra->Msg3_frame = (current_frame + (temp_slot/nr_slots_per_frame[mu]))%1024;
+ ra->Msg3_frame = (current_frame + (temp_slot / n_slots_frame)) % 1024;
// beam association for FR2
if (*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0] >= 257) {
- uint8_t tdd_period_slot = scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSlots + scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
- if ((scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofDownlinkSymbols > 0) || (scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols > 0))
- tdd_period_slot++;
+ AssertFatal(tdd,"Dynamic TDD not handled yet\n");
+ uint8_t tdd_period_slot = n_slots_frame/get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
int num_tdd_period = ra->Msg3_slot/tdd_period_slot;
if((tdd_beam_association[num_tdd_period]!=-1)&&(tdd_beam_association[num_tdd_period]!=ra->beam_id))
AssertFatal(1==0,"Cannot schedule MSG3\n");
@@ -1000,6 +1027,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
int start_symbol_index,nr_of_symbols;
+
SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols);
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
@@ -1020,14 +1048,13 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
pusch_pdu->data_scrambling_id = *scc->physCellId;
pusch_pdu->nrOfLayers = 1;
pusch_pdu->ul_dmrs_symb_pos = get_l_prime(nr_of_symbols,mappingtype,pusch_dmrs_pos2,pusch_len1,start_symbol_index, scc->dmrs_TypeA_Position);
- LOG_D(MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d , ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos);
+ LOG_D(NR_MAC, "MSG3 start_sym:%d NR Symb:%d mappingtype:%d, ul_dmrs_symb_pos:%x\n", start_symbol_index, nr_of_symbols, mappingtype, pusch_pdu->ul_dmrs_symb_pos);
pusch_pdu->dmrs_config_type = 0;
pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId; //If provided and the PUSCH is not a msg3 PUSCH, otherwise, L2 should set this to physical cell id.
pusch_pdu->scid = 0; //DMRS sequence initialization [TS38.211, sec 6.4.1.1.1]. Should match what is sent in DCI 0_1, otherwise set to 0.
pusch_pdu->dmrs_ports = 1; // 6.2.2 in 38.214 only port 0 to be used
pusch_pdu->num_dmrs_cdm_grps_no_data = 2; // no data in dmrs symbols as in 6.2.2 in 38.214
pusch_pdu->resource_alloc = 1; //type 1
-
pusch_pdu->rb_start = msg3_first_rb;
if (msg3_nb_rb > pusch_pdu->bwp_size)
AssertFatal(1==0,"MSG3 allocated number of RBs exceed the BWP size\n");
@@ -1049,6 +1076,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
int num_dmrs_symb = 0;
for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++)
num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1;
+
pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order,
pusch_pdu->target_code_rate,
pusch_pdu->rb_size,
@@ -1332,7 +1360,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
nrOfSymbols,
startSymbolIndex,
- mappingtype);
+ mappingtype, 1);
int x_Overhead = 0;
uint8_t tb_scaling = 0;
@@ -1586,7 +1614,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
scc->dmrs_TypeA_Position,
nrOfSymbols,
startSymbolIndex,
- mappingtype);
+ mappingtype, 1);
uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos);
@@ -2016,25 +2044,16 @@ void nr_fill_rar(uint8_t Mod_idP,
rar->UL_GRANT_4 = (uint8_t) ul_grant & 0xff;
#ifdef DEBUG_RAR
- //LOG_I(NR_MAC, "rarbi->E = 0x%x\n", rarbi->E);
- //LOG_I(NR_MAC, "rarbi->T = 0x%x\n", rarbi->T);
- //LOG_I(NR_MAC, "rarbi->R = 0x%x\n", rarbi->R);
- //LOG_I(NR_MAC, "rarbi->BI = 0x%x\n", rarbi->BI);
-
LOG_I(NR_MAC, "rarh->E = 0x%x\n", rarh->E);
LOG_I(NR_MAC, "rarh->T = 0x%x\n", rarh->T);
LOG_I(NR_MAC, "rarh->RAPID = 0x%x (%i)\n", rarh->RAPID, rarh->RAPID);
-
LOG_I(NR_MAC, "rar->R = 0x%x\n", rar->R);
LOG_I(NR_MAC, "rar->TA1 = 0x%x\n", rar->TA1);
-
LOG_I(NR_MAC, "rar->TA2 = 0x%x\n", rar->TA2);
LOG_I(NR_MAC, "rar->UL_GRANT_1 = 0x%x\n", rar->UL_GRANT_1);
-
LOG_I(NR_MAC, "rar->UL_GRANT_2 = 0x%x\n", rar->UL_GRANT_2);
LOG_I(NR_MAC, "rar->UL_GRANT_3 = 0x%x\n", rar->UL_GRANT_3);
LOG_I(NR_MAC, "rar->UL_GRANT_4 = 0x%x\n", rar->UL_GRANT_4);
-
LOG_I(NR_MAC, "rar->TCRNTI_1 = 0x%x\n", rar->TCRNTI_1);
LOG_I(NR_MAC, "rar->TCRNTI_2 = 0x%x\n", rar->TCRNTI_2);
#endif
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
index 634d2b7d89..2682579a54 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_bch.c
@@ -267,8 +267,9 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
schedule_ssb(frameP, slotP, scc, dl_req, i_ssb, ssbSubcarrierOffset, offset_pointa, (*(uint32_t*)cc->MIB_pdu.payload) & ((1<<24)-1));
fill_ssb_vrb_map(cc, offset_pointa, ssb_start_symbol, CC_id);
const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
- const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
- const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
+ const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+ // FR2 is only TDD, to be fixed for flexible TDD
+ const int nr_slots_period = tdd ? n_slots_frame/get_nb_periods_per_frame(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity) : n_slots_frame;
num_tdd_period = rel_slot/nr_slots_period;
gNB->tdd_beam_association[num_tdd_period]=i_ssb;
num_ssb++;
@@ -387,7 +388,6 @@ uint32_t schedule_control_sib1(module_id_t module_id,
// Calculate number of PRB_DMRS
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
-
LOG_D(MAC,"dlDmrsSymbPos %x\n",dlDmrsSymbPos);
int rbSize = 0;
uint32_t TBS = 0;
@@ -624,8 +624,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
-
- uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
+ uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1);
// Configure sched_ctrlCommon for SIB1
uint32_t TBS = schedule_control_sib1(module_idP, CC_id,
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
index 3557742802..1750ec722a 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
@@ -62,9 +62,22 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
/* there is a mixed slot only when in TDD */
NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon;
+ lte_frame_type_t frame_type = nrmac->common_channels->frame_type;
+ const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
const NR_TDD_UL_DL_Pattern_t *tdd =
scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
- const int symb_dlMixed = tdd ? (1 << tdd->nrofDownlinkSymbols) - 1 : 0;
+
+ int symb_dlMixed = 0;
+ int nr_mix_slots = 0;
+ int nr_slots_period = n;
+ if (tdd) {
+ symb_dlMixed = (1 << tdd->nrofDownlinkSymbols) - 1;
+ nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
+ nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ }
+ else
+ // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration
+ AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n");
int target_ss;
if (bwp) {
@@ -97,7 +110,7 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
/* check that TDA index 1 fits into DL part of mixed slot, if it exists */
int tdaMi = -1;
- if (tdaList->list.count > 1) {
+ if (frame_type == TDD && tdaList->list.count > 1) {
const NR_PDSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1];
AssertFatal(!tdaP_Mi->k0 || *tdaP_Mi->k0 == 0,
"TimeDomainAllocation at index 1: non-null k0 (%ld) is not supported by the scheduler\n",
@@ -120,17 +133,13 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
}
}
- const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160};
- const int n = slots_per_frame[*scc->ssbSubcarrierSpacing];
nrmac->preferred_dl_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_dl_tda[bwp_id]));
- const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0;
- const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n;
for (int i = 0; i < n; ++i) {
nrmac->preferred_dl_tda[bwp_id][i] = -1;
- if (!tdd || i % nr_slots_period < tdd->nrofDownlinkSlots)
+ if (frame_type == FDD || i % nr_slots_period < tdd->nrofDownlinkSlots)
nrmac->preferred_dl_tda[bwp_id][i] = 0;
- else if (tdd && nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots)
+ else if (nr_mix_slots && i % nr_slots_period == tdd->nrofDownlinkSlots)
nrmac->preferred_dl_tda[bwp_id][i] = tdaMi;
LOG_D(MAC, "slot %d preferred_dl_tda %d\n", i, nrmac->preferred_dl_tda[bwp_id][i]);
}
@@ -554,7 +563,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
int rbStart = 0; // start wrt BWPstart
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
- const long f = (sched_ctrl->active_bwp ||bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
+
int rbSize = 0;
const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot];
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
@@ -578,26 +587,29 @@ bool allocate_dl_retransmission(module_id_t module_id,
/* check whether we need to switch the TDA allocation since the last
* (re-)transmission */
if (ps->time_domain_allocation != tda)
- nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps);
+ nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
} else {
/* the retransmission will use a different time domain allocation, check
* that we have enough resources */
- NR_pdsch_semi_static_t temp_ps;
- temp_ps.nrOfLayers = 1;
- nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps);
+
+ NR_pdsch_semi_static_t temp_ps = *ps;
+ nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, &temp_ps);
while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
rbStart++;
while (rbStart + rbSize < bwpSize &&
(rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
rbSize++;
+
uint32_t new_tbs;
uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm,
retInfo->R,
+ temp_ps.nrOfLayers,
temp_ps.nrOfSymbols,
temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT,
retInfo->tb_size,
+ 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */
rbSize,
&new_tbs,
&new_rbSize);
@@ -693,6 +705,7 @@ void pf_dl(module_id_t module_id,
float coeff_ue[MAX_MOBILES_PER_GNB];
// UEs that could be scheduled
int ue_array[MAX_MOBILES_PER_GNB];
+ int layers[MAX_MOBILES_PER_GNB];
NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB };
/* Loop UE_info->list to check retransmission */
@@ -705,6 +718,8 @@ void pf_dl(module_id_t module_id,
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
+ layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the strcuture
+
/* Calculate Throughput */
const float a = 0.0005f; // corresponds to 200ms window
const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes;
@@ -728,9 +743,19 @@ void pf_dl(module_id_t module_id,
continue;
/* Calculate coeff */
- ps->nrOfLayers = 1;
+ set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx);
sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id);
- uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs];
+ layers[UE_id] = set_dl_nrOfLayers(sched_ctrl);
+ const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
+ const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
+ uint32_t tbs = nr_compute_tbs(Qm,
+ R,
+ 1, /* rbSize */
+ 10, /* hypothetical number of slots */
+ 0, /* N_PRB_DMRS * N_DMRS_SLOT */
+ 0 /* N_PRB_oh, 0 for initialBWP */,
+ 0 /* tb_scaling */,
+ layers[UE_id]) >> 3;
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n",
b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]);
@@ -739,8 +764,9 @@ void pf_dl(module_id_t module_id,
}
}
+ const int min_rbSize = 5;
/* Loop UE_sched to find max coeff and allocate transmission */
- while (max_num_ue > 0 && n_rb_sched > 0 && UE_sched.head >= 0) {
+ while (max_num_ue > 0 && n_rb_sched >= min_rbSize && UE_sched.head >= 0) {
/* Find max coeff from UE_sched*/
int *max = &UE_sched.head; /* assume head is max */
@@ -800,9 +826,6 @@ void pf_dl(module_id_t module_id,
LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti);
continue;
}
- /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
- max_num_ue--;
- if (max_num_ue < 0) return;
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
* allocation after CCE alloc fail would be more complex) */
@@ -816,9 +839,14 @@ void pf_dl(module_id_t module_id,
frame,
slot);
mac->pdcch_cand[cid]--;
- return;
+ continue;
}
+ /* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE
+ * and PUCCH */
+ max_num_ue--;
+ AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue);
+
sched_ctrl->cce_index = CCEIndex;
fill_pdcch_vrb_map(mac,
@@ -833,9 +861,10 @@ void pf_dl(module_id_t module_id,
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
- const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
- if (ps->time_domain_allocation != tda)
- nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps);
+
+ if (ps->nrOfLayers != layers[UE_id] ||
+ ps->time_domain_allocation != tda)
+ nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps);
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
// Freq-demain allocation
@@ -856,9 +885,11 @@ void pf_dl(module_id_t module_id,
const int oh = 3 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
nr_find_nb_rb(sched_pdsch->Qm,
sched_pdsch->R,
+ ps->nrOfLayers,
ps->nrOfSymbols,
ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
sched_ctrl->num_total_bytes + oh,
+ min_rbSize,
max_rbSize,
&TBS,
&rbSize);
@@ -886,7 +917,10 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
/* This is temporary and it assumes all UEs have the same BWP and TDA*/
int UE_id = UE_info->list.head;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
- const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot];
+ const int bwp_id = sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0;
+ if (!RC.nrmac[module_id]->preferred_dl_tda[bwp_id])
+ return;
+ const int tda = RC.nrmac[module_id]->preferred_dl_tda[bwp_id][slot];
int startSymbolIndex, nrOfSymbols;
const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = sched_ctrl->active_bwp ?
sched_ctrl->active_bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
@@ -1036,8 +1070,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
harq->is_waiting = true;
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
- LOG_D(NR_MAC,
- "%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n",
+ LOG_D(NR_MAC,"%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d nrOfLayers %d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n",
frame,
slot,
UE_id,
@@ -1049,6 +1082,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
ps->nrOfSymbols,
ps->dl_dmrs_symb_pos,
sched_pdsch->mcs,
+ nrOfLayers,
TBS,
current_harq_pid,
harq->round,
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
index accb347533..fddf084a38 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c
@@ -165,7 +165,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
scc->dmrs_TypeA_Position,
NrOfSymbols,
StartSymbolIndex,
- mappingtype);
+ mappingtype, 1);
/*
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
@@ -278,12 +278,11 @@ void nr_preprocessor_phytest(module_id_t module_id,
UE_id);
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
- const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
ps->nrOfLayers = target_dl_Nl;
- if (ps->time_domain_allocation != tda)
- nr_set_pdsch_semi_static(
- scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps);
+
+ if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl)
+ nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps);
/* find largest unallocated chunk */
const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
@@ -520,12 +519,14 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
sched_ctrl->coreset,
Y);
- if (sched_ctrl->cce_index < 0) {
+ if (CCEIndex < 0) {
LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__);
nr_mac->pdcch_cand[cid]--;
return false;
}
+ sched_ctrl->cce_index = CCEIndex;
+
const int mcs = target_ul_mcs;
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->mcs = mcs;
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
index a1dfc7c833..938b9f2584 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
@@ -113,6 +113,20 @@ uint8_t nr_ss_first_symb_idx_scs_120_120_mux3[4] = {4,8,2,6};
uint8_t nr_max_number_of_candidates_per_slot[4] = {44, 36, 22, 20};
uint8_t nr_max_number_of_cces_per_slot[4] = {56, 56, 48, 32};
+// CQI TABLES
+// Table 1 (38.214 5.2.2.1-2)
+uint16_t cqi_table1[16][2] = {{0,0},{2,78},{2,120},{2,193},{2,308},{2,449},{2,602},{4,378},
+ {4,490},{4,616},{6,466},{6,567},{6,666},{6,772},{6,873},{6,948}};
+
+// Table 2 (38.214 5.2.2.1-3)
+uint16_t cqi_table2[16][2] = {{0,0},{2,78},{2,193},{2,449},{4,378},{4,490},{4,616},{6,466},
+ {6,567},{6,666},{6,772},{6,873},{8,711},{8,797},{8,885},{8,948}};
+
+// Table 2 (38.214 5.2.2.1-4)
+uint16_t cqi_table3[16][2] = {{0,0},{2,30},{2,50},{2,78},{2,120},{2,193},{2,308},{2,449},
+ {2,602},{4,378},{4,490},{4,616},{6,466},{6,567},{6,666},{6,772}};
+
+
static inline uint8_t get_max_candidates(uint8_t scs) {
AssertFatal(scs<4, "Invalid PDCCH subcarrier spacing %d\n", scs);
return (nr_max_number_of_candidates_per_slot[scs]);
@@ -123,6 +137,59 @@ static inline uint8_t get_max_cces(uint8_t scs) {
return (nr_max_number_of_cces_per_slot[scs]);
}
+uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) {
+
+ // TODO check this but it should be enough for now
+ // if there is not csi report RI is 0 from initialization
+ return (sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1);
+
+}
+
+void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
+ NR_UE_sched_ctrl_t *sched_ctrl,
+ uint8_t *target_mcs,
+ uint8_t mcs_table_idx) {
+
+ if (sched_ctrl->set_mcs) {
+ // TODO for wideband case and multiple TB
+ int cqi_idx = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb;
+ uint16_t target_coderate,target_qm;
+ if (cqi_idx>0) {
+ int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table;
+ AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n");
+ switch (cqi_table) {
+ case 0:
+ target_qm = cqi_table1[cqi_idx][0];
+ target_coderate = cqi_table1[cqi_idx][1];
+ break;
+ case 1:
+ target_qm = cqi_table2[cqi_idx][0];
+ target_coderate = cqi_table2[cqi_idx][1];
+ break;
+ case 2:
+ target_qm = cqi_table3[cqi_idx][0];
+ target_coderate = cqi_table3[cqi_idx][1];
+ break;
+ default:
+ AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table);
+ }
+ int max_mcs = 28;
+ int R,Qm;
+ if (mcs_table_idx == 1)
+ max_mcs = 27;
+ for (int i=0; i<=max_mcs; i++) {
+ R = nr_get_code_rate_dl(i, mcs_table_idx);
+ Qm = nr_get_Qm_dl(i, mcs_table_idx);
+ if ((Qm == target_qm) && (target_coderate <= R)) {
+ *target_mcs = i;
+ break;
+ }
+ }
+ }
+ sched_ctrl->set_mcs = FALSE;
+ }
+}
+
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
//TODO first basic implementation of dmrs port selection
@@ -130,23 +197,29 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
// for now it assumes a selection of Nl consecutive dmrs ports
// and a single front loaded symbol
// dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4
+ // number of front loaded symbols need to be consistent with maxLength
+ // when a more complete implementation is done
switch (ps->nrOfLayers) {
case 1:
ps->dmrs_ports_id = 0;
ps->numDmrsCdmGrpsNoData = 1;
+ ps->frontloaded_symb = 1;
break;
case 2:
ps->dmrs_ports_id = 2;
ps->numDmrsCdmGrpsNoData = 1;
+ ps->frontloaded_symb = 1;
break;
case 3:
ps->dmrs_ports_id = 9;
ps->numDmrsCdmGrpsNoData = 2;
+ ps->frontloaded_symb = 1;
break;
case 4:
ps->dmrs_ports_id = 10;
ps->numDmrsCdmGrpsNoData = 2;
+ ps->frontloaded_symb = 1;
break;
default:
AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers);
@@ -385,16 +458,18 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac,
bool nr_find_nb_rb(uint16_t Qm,
uint16_t R,
+ uint8_t nrOfLayers,
uint16_t nb_symb_sch,
uint16_t nb_dmrs_prb,
uint32_t bytes,
+ uint16_t nb_rb_min,
uint16_t nb_rb_max,
uint32_t *tbs,
uint16_t *nb_rb)
{
/* is the maximum (not even) enough? */
*nb_rb = nb_rb_max;
- *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
+ *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
/* check whether it does not fit, or whether it exactly fits. Some algorithms
* might depend on the return value! */
if (bytes > *tbs)
@@ -403,17 +478,17 @@ bool nr_find_nb_rb(uint16_t Qm,
return true;
/* is the minimum enough? */
- *nb_rb = 5;
- *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
+ *nb_rb = nb_rb_min;
+ *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
if (bytes <= *tbs)
return true;
/* perform binary search to allocate all bytes within a TBS up to nb_rb_max
* RBs */
int hi = nb_rb_max;
- int lo = 1;
+ int lo = nb_rb_min;
for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) {
- const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
+ const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
if (bytes == TBS) {
hi = p;
break;
@@ -424,7 +499,7 @@ bool nr_find_nb_rb(uint16_t Qm,
}
}
*nb_rb = hi;
- *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
+ *tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
/* return whether we could allocate all bytes and stay below nb_rb_max */
return *tbs >= bytes && *nb_rb <= nb_rb_max;
}
@@ -434,18 +509,12 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_BWP_Downlink_t *bwp,
const NR_BWP_DownlinkDedicated_t *bwpd0,
int tda,
- const long dci_format,
+ uint8_t layers,
+ NR_UE_sched_ctrl_t *sched_ctrl,
NR_pdsch_semi_static_t *ps)
{
- ps->time_domain_allocation = tda;
+ bool reset_dmrs = false;
- const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ?
- bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
- scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
- AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
- const int mapping_type = tdaList->list.array[tda]->mappingType;
- const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
- SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
NR_BWP_DownlinkDedicated_t *bwpd;
if (bwp && bwp->bwp_Dedicated) {
@@ -454,7 +523,6 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
bwpd = (NR_BWP_DownlinkDedicated_t*)bwpd0;
}
- ps->mcsTableIdx = 0;
if (bwpd->pdsch_Config &&
bwpd->pdsch_Config->choice.setup &&
bwpd->pdsch_Config->choice.setup->mcs_Table) {
@@ -465,15 +533,67 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
}
else ps->mcsTableIdx = 0;
- if(dci_format == 0) // format 1_0
- ps->numDmrsCdmGrpsNoData = (ps->nrOfSymbols == 2 ? 1 : 2);
+ NR_PDSCH_Config_t *pdsch_Config;
+ if (bwp &&
+ bwp->bwp_Dedicated &&
+ bwp->bwp_Dedicated->pdsch_Config &&
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup)
+ pdsch_Config = bwp->bwp_Dedicated->pdsch_Config->choice.setup;
else
- set_dl_dmrs_ports(ps);
- ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
+ pdsch_Config = NULL;
+
+ if (ps->time_domain_allocation != tda) {
+ reset_dmrs = true;
+ ps->time_domain_allocation = tda;
+ const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ?
+ bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
+ scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
+ AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
+ ps->mapping_type = tdaList->list.array[tda]->mappingType;
+ if (pdsch_Config) {
+ if (ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB)
+ ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type == NULL ? 0 : 1;
+ else
+ ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
+ }
+ else
+ ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1;
+ const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
+ SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
+ }
+
+ const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
+ int dci_format;
+ if (sched_ctrl->search_space) {
+ dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
+ }
+ else {
+ dci_format = NR_DL_DCI_FORMAT_1_0;
+ }
+ if (dci_format == NR_DL_DCI_FORMAT_1_0) {
+ if (ps->nrOfSymbols == 2)
+ ps->numDmrsCdmGrpsNoData = 1;
+ else
+ ps->numDmrsCdmGrpsNoData = 2;
+ ps->dmrs_ports_id = 0;
+ ps->frontloaded_symb = 1;
+ ps->nrOfLayers = 1;
+ }
+ else {
+ if (ps->nrOfLayers != layers ||
+ ps->numDmrsCdmGrpsNoData == 0) {
+ reset_dmrs = true;
+ ps->nrOfLayers = layers;
+ set_dl_dmrs_ports(ps);
+ }
+ }
ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
- ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
- ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
+
+ if (reset_dmrs) {
+ ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb);
+ ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
+ }
LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT);
}
@@ -1822,14 +1942,46 @@ void dump_nr_list(NR_list_t *listP)
void create_nr_list(NR_list_t *list, int len)
{
list->head = -1;
- list->next = calloc(len, sizeof(*list->next));
- AssertFatal(list, "cannot calloc() memory for NR_list_t->next\n");
+ list->next = malloc(len * sizeof(*list->next));
+ LOG_W(NR_MAC, "NR list->next %p\n", list->next);
+ AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n");
for (int i = 0; i < len; ++i)
list->next[i] = -1;
list->tail = -1;
list->len = len;
}
+/*
+ * Resize an NR_list
+ */
+void resize_nr_list(NR_list_t *list, int new_len)
+{
+ if (new_len == list->len)
+ return;
+ if (new_len > list->len) {
+ /* list->head remains */
+ const int old_len = list->len;
+ int* n = realloc(list->next, new_len * sizeof(*list->next));
+ AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
+ list->next = n;
+ for (int i = old_len; i < new_len; ++i)
+ list->next[i] = -1;
+ /* list->tail remains */
+ list->len = new_len;
+ } else { /* new_len < len */
+ AssertFatal(list->head < new_len, "shortened list head out of index %d (new len %d)\n", list->head, new_len);
+ AssertFatal(list->tail < new_len, "shortened list tail out of index %d (new len %d)\n", list->head, new_len);
+ for (int i = 0; i < list->len; ++i)
+ AssertFatal(list->next[i] < new_len, "shortened list entry out of index %d (new len %d)\n", list->next[i], new_len);
+ /* list->head remains */
+ int *n = realloc(list->next, new_len * sizeof(*list->next));
+ AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
+ list->next = n;
+ /* list->tail remains */
+ list->len = new_len;
+ }
+}
+
/*
* Destroy an NR_list
*/
@@ -2027,6 +2179,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP);
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
+ sched_ctrl->set_mcs = TRUE;
sched_ctrl->lcid_mask = 0;
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
sched_ctrl->lcid_mask = 1<pdsch_ServingCellConfig->choice.setup : NULL;
- // add DL HARQ processes for this UE only in NSA
- // (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage)
- if (!get_softmodem_params()->sa)
- create_dl_harq_list(sched_ctrl,pdsch);
+ // pdsch == NULL in SA -> will create default (8) number of HARQ processes
+ create_dl_harq_list(sched_ctrl, pdsch);
// add all available UL HARQ processes for this UE
// nb of ul harq processes not configurable
create_nr_list(&sched_ctrl->available_ul_harq, 16);
@@ -2115,11 +2266,23 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
// add all available DL HARQ processes for this UE
- create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
- for (int harq = 0; harq < nrofHARQ; harq++)
- add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
- create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
- create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
+ AssertFatal(sched_ctrl->available_dl_harq.len == sched_ctrl->feedback_dl_harq.len
+ && sched_ctrl->available_dl_harq.len == sched_ctrl->retrans_dl_harq.len,
+ "HARQ lists have different lengths (%d/%d/%d)\n",
+ sched_ctrl->available_dl_harq.len,
+ sched_ctrl->feedback_dl_harq.len,
+ sched_ctrl->retrans_dl_harq.len);
+ if (sched_ctrl->available_dl_harq.len == 0) {
+ create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
+ for (int harq = 0; harq < nrofHARQ; harq++)
+ add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
+ create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
+ create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
+ } else {
+ resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
+ resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
+ resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
+ }
}
/* hack data to remove UE in the phy */
@@ -2271,12 +2434,12 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
}
AssertFatal(found==1,"Couldn't find a ue specific searchspace\n");
-
if (ss->searchSpaceType->choice.ue_Specific->dci_Formats == NR_SearchSpace__searchSpaceType__ue_Specific__dci_Formats_formats0_0_And_1_0) {
for (int i=0; i<8; i++) {
pdsch_to_harq_feedback[i] = i+1;
if(pdsch_to_harq_feedback[i]>*max_fb_time)
*max_fb_time = pdsch_to_harq_feedback[i];
+
}
}
else {
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
index 15c0c23feb..cfff41a6ad 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
@@ -32,6 +32,7 @@
#include "NR_MAC_COMMON/nr_mac_extern.h"
#include "NR_MAC_gNB/mac_proto.h"
#include "common/ran_context.h"
+#include "common/utils/nr/nr_common.h"
#include "nfapi/oai_integration/vendor_ext.h"
extern RAN_CONTEXT_t RC;
@@ -160,7 +161,7 @@ void nr_schedule_pucch(int Mod_idP,
//! Calculating number of bits set
-uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){
+uint8_t number_of_bits_set (uint8_t buf){
uint8_t nb_of_bits_set = 0;
uint8_t mask = 0xff;
uint8_t index = 0;
@@ -171,14 +172,13 @@ uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){
mask>>=1;
}
- *max_ri = 8-index;
return nb_of_bits_set;
}
void compute_rsrp_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
uint8_t nb_resources,
- nr_csi_report_t *csi_report){
+ nr_csi_report_t *csi_report) {
if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled == csi_reportconfig->groupBasedBeamReporting.present) {
if (NULL != csi_reportconfig->groupBasedBeamReporting.choice.disabled->nrofReportedRS)
@@ -210,42 +210,24 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
nr_csi_report_t *csi_report){
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
- uint8_t nb_allowed_ri, ri_restriction,ri_bitlen;
- uint8_t max_ri = 0;
+ uint8_t nb_allowed_ri, ri_bitlen;
+ uint8_t ri_restriction = 0;
if (codebookConfig == NULL) {
csi_report->csi_meas_bitlen.ri_bitlen=0;
- return max_ri;
+ return ri_restriction;
}
// codebook type1 single panel
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two){
- // two antenna ports case
- /* From Spec 38.212
- * If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
- * values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
- * TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
- * 5.2.2.2.1 [6, TS 38.214].
- *
- * But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
- * calculate RI for antennas equal or more than two.
- * */
- AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
- /* Replace dummy with the nrofCQIsPerReport from the CSIreport
- config when equalent ASN structure present */
- if (0==*(csi_reportconfig->dummy)){
- nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
- else{
- nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
+ nb_allowed_ri = number_of_bits_set(ri_restriction);
+ ri_bitlen = ceil(log2(nb_allowed_ri));
+
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
}
@@ -253,43 +235,27 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present ==
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
// 4 ports
- AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
- /* Replace dummy with the nrofCQIsPerReport from the CSIreport
- config when equalent ASN structure present*/
- if (0==*(csi_reportconfig->dummy)){
- nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
- else{
- nb_allowed_ri = number_of_bits_set(ri_restriction,&max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
+ nb_allowed_ri = number_of_bits_set(ri_restriction);
+ ri_bitlen = ceil(log2(nb_allowed_ri));
+
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
}
else {
// more than 4 ports
- AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
- /* Replace dummy with the nrofCQIsPerReport from the CSIreport
- config when equalent ASN structure present */
- if (0==*(csi_reportconfig->dummy)){
- nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0),&max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
- else{
- nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
- ri_bitlen = ceil(log2(nb_allowed_ri));
- }
+ nb_allowed_ri = number_of_bits_set(ri_restriction);
+ ri_bitlen = ceil(log2(nb_allowed_ri));
+
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
}
}
- return max_ri;
+ return ri_restriction;
}
else
AssertFatal(1==0,"Other configurations not yet implemented\n");
@@ -297,66 +263,295 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
}
void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
- uint8_t max_ri,
+ uint8_t ri_restriction,
nr_csi_report_t *csi_report){
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
- if (codebookConfig == NULL) {
- csi_report->csi_meas_bitlen.li_bitlen=0;
- return;
+ for(int i=0; i<8; i++) {
+ if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0)
+ csi_report->csi_meas_bitlen.li_bitlen[i]=0;
+ else {
+ // codebook type1 single panel
+ if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present)
+ csi_report->csi_meas_bitlen.li_bitlen[i]=ceil(log2(i+1))<2?ceil(log2(i+1)):2;
+ else
+ AssertFatal(1==0,"Other configurations not yet implemented\n");
+ }
}
- // codebook type1 single panel
- if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){
- /* From Spec 38.212
- * If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
- * values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
- * TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
- * 5.2.2.2.1 [6, TS 38.214].
- *
- * But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
- * calculate RI for antennas equal or more than two.
- */
- //! TODO: The bit length of LI is as follows LI = log2(RI), Need to confirm wheather we should consider maximum RI can be reported from ri_restricted
- // or we should consider reported RI. If we need to consider reported RI for calculating LI bit length then we need to modify the code.
- csi_report->csi_meas_bitlen.li_bitlen=ceil(log2(max_ri))<2?ceil(log2(max_ri)):2;
- }
- else
- AssertFatal(1==0,"Other configurations not yet implemented\n");
}
+void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2,
+ struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *morethantwo) {
+
+ // Table 5.2.2.2.1-2 in 38.214 for supported configurations
+ switch(morethantwo->n1_n2.present){
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction):
+ *n1 = 2;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction):
+ *n1 = 2;
+ *n2 = 2;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction):
+ *n1 = 4;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction):
+ *n1 = 3;
+ *n2 = 2;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction):
+ *n1 = 6;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction):
+ *n1 = 4;
+ *n2 = 2;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction):
+ *n1 = 8;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction):
+ *n1 = 4;
+ *n2 = 3;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction):
+ *n1 = 4;
+ *n2 = 2;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction):
+ *n1 = 12;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction):
+ *n1 = 4;
+ *n2 = 4;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction):
+ *n1 = 8;
+ *n2 = 2;
+ *o1 = 4;
+ *o2 = 4;
+ break;
+ case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction):
+ *n1 = 16;
+ *n2 = 1;
+ *o1 = 4;
+ *o2 = 1;
+ break;
+ default:
+ AssertFatal(1==0,"Not supported configuration for n1_n2 in codebook configuration");
+ }
+}
+
+void get_x1x2_bitlen_singlepanel(int n1, int n2, int o1, int o2,
+ int *x1, int *x2, int rank, int codebook_mode) {
+
+ // Table 6.3.1.1.2-1 in 38.212
+ switch(rank){
+ case 1:
+ if(n2>1) {
+ if (codebook_mode == 1) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 2;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
+ *x2 = 4;
+ }
+ }
+ else{
+ if (codebook_mode == 1) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 2;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1/2));
+ *x2 = 4;
+ }
+ }
+ break;
+ case 2:
+ if(n1*n2 == 2) {
+ if (codebook_mode == 1) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1/2));
+ *x2 = 3;
+ }
+ *x1 += 1;
+ }
+ else {
+ if(n2>1) {
+ if (codebook_mode == 1) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 3;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
+ *x2 = 3;
+ }
+ }
+ else{
+ if (codebook_mode == 1) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1/2));
+ *x2 = 3;
+ }
+ }
+ *x1 += 2;
+ }
+ break;
+ case 3:
+ case 4:
+ if(n1*n2 == 2) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ }
+ else {
+ if(n1*n2 >= 8) {
+ *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)) + 2;
+ *x2 = 1;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)) + 2;
+ *x2 = 1;
+ }
+ }
+ break;
+ case 5:
+ case 6:
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ break;
+ case 7:
+ case 8:
+ if(n1 == 4 && n2 == 1) {
+ *x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ }
+ else {
+ if(n1 > 2 && n2 == 2) {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2/2));
+ *x2 = 1;
+ }
+ else {
+ *x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
+ *x2 = 1;
+ }
+ }
+ break;
+ default:
+ AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n");
+ }
+}
+
+
+void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
+ uint8_t ri_restriction,
+ nr_csi_report_t *csi_report){
+
+ struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
+ for(int i=0; i<8; i++) {
+ csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=0;
+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=0;
+ if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0)
+ return;
+ else {
+ if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) {
+ if(codebookConfig->codebookType.choice.type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) {
+ if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present ==
+ NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) {
+ if (i==0)
+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=2;
+ if (i==1)
+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1;
+ }
+ else { // more than two
+ int n1,n2,o1,o2,x1,x2;
+ get_n1n2_o1o2_singlepanel(&n1,&n2,&o1,&o2,codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo);
+ get_x1x2_bitlen_singlepanel(n1,n2,o1,o2,&x1,&x2,i+1,codebookConfig->codebookType.choice.type1->codebookMode);
+ csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=x1;
+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=x2;
+ }
+ }
+ else
+ AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n");
+ }
+ else
+ AssertFatal(1==0,"Type2 Codebook Config not yet implemented\n");
+ }
+ }
+}
+
void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
- uint8_t max_ri,
+ uint8_t ri_restriction,
nr_csi_report_t *csi_report){
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
struct NR_CSI_ReportConfig__reportFreqConfiguration *freq_config = csi_reportconfig->reportFreqConfiguration;
if (*freq_config->cqi_FormatIndicator == NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI) {
- csi_report->csi_meas_bitlen.cqi_bitlen = 4;
- if(codebookConfig != NULL) {
- if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){
- struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
- if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) {
- if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present >
- NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
- // more than 4 antenna ports
- if (max_ri > 4)
- csi_report->csi_meas_bitlen.cqi_bitlen += 4; // CQI for second TB
+ for(int i=0; i<8; i++) {
+ if ((ri_restriction>>i)&0x01) {
+ csi_report->csi_meas_bitlen.cqi_bitlen[i] = 4;
+ if(codebookConfig != NULL) {
+ if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){
+ struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
+ if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) {
+ if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present >
+ NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
+ // more than 4 antenna ports
+ if (i > 4)
+ csi_report->csi_meas_bitlen.cqi_bitlen[i] += 4; // CQI for second TB
+ }
+ }
}
}
}
+ else
+ csi_report->csi_meas_bitlen.cqi_bitlen[i] = 0;
}
}
else
AssertFatal(1==0,"Sub-band CQI reporting not yet supported");
}
+
//!TODO : same function can be written to handle csi_resources
void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){
uint8_t csi_report_id = 0;
uint8_t nb_resources = 0;
- uint8_t max_ri = 0;
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type;
NR_CSI_ResourceConfigId_t csi_ResourceConfigId;
struct NR_CSI_ResourceConfig *csi_resourceconfig;
@@ -427,8 +622,21 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
break;
case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI):
csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
- max_ri = compute_ri_bitlen(csi_reportconfig, csi_report);
- compute_cqi_bitlen(csi_reportconfig, max_ri, csi_report);
+ csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
+ compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
+ break;
+ case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI):
+ csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
+ csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
+ compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
+ compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
+ break;
+ case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI):
+ csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
+ csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
+ compute_li_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
+ compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
+ compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
break;
default:
AssertFatal(1==0,"Not yet supported CSI report quantity type");
@@ -441,7 +649,8 @@ uint16_t nr_get_csi_bitlen(int Mod_idP,
int UE_id,
uint8_t csi_report_id) {
- uint16_t csi_bitlen =0;
+ uint16_t csi_bitlen = 0;
+ uint16_t max_bitlen = 0;
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
L1_RSRP_bitlen_t * CSI_report_bitlen = NULL;
CSI_Meas_bitlen_t * csi_meas_bitlen = NULL;
@@ -454,7 +663,18 @@ uint16_t nr_get_csi_bitlen(int Mod_idP,
(CSI_report_bitlen->nb_ssbri_cri -1 )));
} else{
csi_meas_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
- csi_bitlen+= (csi_meas_bitlen->cri_bitlen +csi_meas_bitlen->ri_bitlen+csi_meas_bitlen->li_bitlen+csi_meas_bitlen->cqi_bitlen+csi_meas_bitlen->pmi_x1_bitlen+csi_meas_bitlen->pmi_x2_bitlen);
+ uint16_t temp_bitlen;
+ for (int i=0; i<8; i++) {
+ temp_bitlen = (csi_meas_bitlen->cri_bitlen+
+ csi_meas_bitlen->ri_bitlen+
+ csi_meas_bitlen->li_bitlen[i]+
+ csi_meas_bitlen->cqi_bitlen[i]+
+ csi_meas_bitlen->pmi_x1_bitlen[i]+
+ csi_meas_bitlen->pmi_x2_bitlen[i]);
+ if(temp_bitlen>max_bitlen)
+ max_bitlen = temp_bitlen;
+ }
+ csi_bitlen += max_bitlen;
}
return csi_bitlen;
@@ -717,36 +937,32 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
idx: resource set index
*/
- //for all reported SSB
- for (idx = 0; idx < nb_of_csi_ssb_report; idx++) {
- nr_ssbri_cri = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri;
- //extracting the ssb indexes
- for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
- ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[ssb_idx];
- }
-
- //if strongest measured RSRP is configured
- strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
- ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
- LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
-
- //if current ssb rsrp is greater than better rsrp
- if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
- better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report];
- target_ssb_beam_index = idx * nb_of_csi_ssb_report;
- }
-
- for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) {
- ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp);
-
- //if current reported rsrp is greater than better rsrp
- if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) {
- better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx];
- target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx;
- }
- }
+ nr_ssbri_cri = sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri;
+ //extracting the ssb indexes
+ for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
+ ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[ssb_idx];
}
+ //if strongest measured RSRP is configured
+ strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
+ ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
+ LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
+
+ //if current ssb rsrp is greater than better rsrp
+ if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
+ better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report];
+ target_ssb_beam_index = idx * nb_of_csi_ssb_report;
+ }
+
+ for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) {
+ ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp);
+
+ //if current reported rsrp is greater than better rsrp
+ if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) {
+ better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx];
+ target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx;
+ }
+ }
if(ssb_index[target_ssb_beam_index] != ssb_index[curr_ssb_beam_index] && ssb_rsrp[target_ssb_beam_index] > ssb_rsrp[curr_ssb_beam_index]) {
if( ssb_rsrp[target_ssb_beam_index] - ssb_rsrp[curr_ssb_beam_index] > L1_RSRP_HYSTERIS) {
@@ -875,7 +1091,8 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
int *cumul_bits,
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){
- uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen;
+ nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id];
+ uint8_t cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen;
uint16_t curr_payload;
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
@@ -896,44 +1113,43 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
multiple simultaneous spatial domain receive filter
*/
- int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri;
+ sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri;
- for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
+ for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits);
- if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
- *(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
- else
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
- *(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
-
+ if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) {
+ sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
+ *(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
+ LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
+ }
+ else {
+ sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
+ *(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
+ LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
+ }
*cumul_bits += cri_ssbri_bitlen;
- if(UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type == NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP)
- LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
- else
- LOG_D(MAC,"SSB Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
+
}
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = curr_payload & 0x7f;
+ sched_ctrl->CSI_report.ssb_cri_report.RSRP = curr_payload & 0x7f;
*cumul_bits += 7;
- for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
+ for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
curr_payload = pickandreverse_bits(payload, 4, *cumul_bits);
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f;
+ sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f;
*cumul_bits += 4;
}
- UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
- int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
+ csi_report->nb_of_csi_ssb_report++;
+ int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
// including ssb rsrp in mac stats
stats->cumul_rsrp += strongest_ssb_rsrp;
stats->num_rsrp_meas++;
LOG_D(MAC,"rsrp_id = %d rsrp = %d\n",
- sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP,
- strongest_ssb_rsrp);
+ sched_ctrl->CSI_report.ssb_cri_report.RSRP,
+ get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP));
}
@@ -942,39 +1158,122 @@ void evaluate_cri_report(uint8_t *payload,
int cumul_bits,
NR_UE_sched_ctrl_t *sched_ctrl){
- int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id?
-
uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits);
- sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri;
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cri = temp_cri;
}
-void evaluate_ri_report(uint8_t *payload,
- uint8_t ri_bitlen,
- NR_UE_sched_ctrl_t *sched_ctrl){
+int evaluate_ri_report(uint8_t *payload,
+ uint8_t ri_bitlen,
+ uint8_t ri_restriction,
+ int cumul_bits,
+ NR_UE_sched_ctrl_t *sched_ctrl){
- AssertFatal(1==0,"Evaluation of RI report not yet implemented\n");
+ uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits);
+ int count=0;
+ for (int i=0; i<8; i++) {
+ if ((ri_restriction>>i)&0x01) {
+ if(count == ri_index) {
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i;
+ LOG_I(MAC,"CSI Reported Rank %d\n", i+1);
+ return i;
+ }
+ count++;
+ }
+ }
+ AssertFatal(1==0, "Decoded ri %d does not correspond to any valid value in ri_restriction %d\n",ri_index,ri_restriction);
}
void evaluate_cqi_report(uint8_t *payload,
- uint8_t cqi_bitlen,
- int *cumul_bits,
- NR_UE_sched_ctrl_t *sched_ctrl){
+ nr_csi_report_t *csi_report,
+ int cumul_bits,
+ uint8_t ri,
+ NR_UE_sched_ctrl_t *sched_ctrl,
+ long *cqi_Table){
//TODO sub-band CQI report not yet implemented
- int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id?
-
- uint8_t temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits);
- sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi;
- *cumul_bits += 4;
+ int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri];
+
+ uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits);
+
+ // NR_CSI_ReportConfig__cqi_Table_table1 = 0
+ // NR_CSI_ReportConfig__cqi_Table_table2 = 1
+ // NR_CSI_ReportConfig__cqi_Table_table3 = 2
+ if (cqi_Table)
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table;
+ else
+ AssertFatal(1==0,"CQI Table not present in RRC configuration\n");
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi;
LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi);
if (cqi_bitlen > 4) {
- temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits);
- sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi;
+ temp_cqi = pickandreverse_bits(payload, 4, cumul_bits);
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi;
LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi);
}
+ sched_ctrl->set_mcs = TRUE;
}
+
+uint8_t evaluate_pmi_report(uint8_t *payload,
+ nr_csi_report_t *csi_report,
+ int cumul_bits,
+ uint8_t ri,
+ NR_UE_sched_ctrl_t *sched_ctrl){
+
+ int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri];
+ int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri];
+ int tot_bitlen = x1_bitlen + x2_bitlen;
+
+ //in case of 2 port CSI configuration x1 is empty and the information bits are in x2
+ int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits);
+
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1,
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2);
+
+ return tot_bitlen;
+
+}
+
+
+int evaluate_li_report(uint8_t *payload,
+ nr_csi_report_t *csi_report,
+ int cumul_bits,
+ uint8_t ri,
+ NR_UE_sched_ctrl_t *sched_ctrl){
+
+ int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri];
+
+ if (li_bitlen>0) {
+ int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits);
+ LOG_I(MAC,"LI %d\n",temp_li);
+ sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li;
+ }
+ return li_bitlen;
+
+}
+
+void skip_zero_padding(int *cumul_bits,
+ nr_csi_report_t *csi_report,
+ uint8_t ri,
+ uint16_t max_bitlen) {
+
+ // actual number of reported bits depends on the reported rank
+ // zero padding bits are added to have a predetermined max bit length to decode
+
+ uint16_t reported_bitlen = csi_report->csi_meas_bitlen.cri_bitlen+
+ csi_report->csi_meas_bitlen.ri_bitlen+
+ csi_report->csi_meas_bitlen.li_bitlen[ri]+
+ csi_report->csi_meas_bitlen.cqi_bitlen[ri]+
+ csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+
+ csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri];
+
+ *cumul_bits+=(max_bitlen-reported_bitlen);
+}
+
+
void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu,
frame_t frame,
@@ -987,21 +1286,25 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon;
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
uint8_t *payload = uci_pdu->csi_part1.csi_part1_payload;
+ uint16_t bitlen = uci_pdu->csi_part1.csi_part1_bit_len;
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING;
NR_UE_info_t *UE_info = &(RC.nrmac[Mod_idP]->UE_info);
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
int cumul_bits = 0;
+ int r_index = -1;
for (int csi_report_id = 0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) {
- UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0;
+ nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id];
+ csi_report->nb_of_csi_ssb_report = 0;
uint8_t cri_bitlen = 0;
uint8_t ri_bitlen = 0;
- uint8_t cqi_bitlen = 0;
+ uint8_t li_bitlen = 0;
+ uint8_t pmi_bitlen = 0;
NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
int period, offset;
csi_period_offset(csirep, NULL, &period, &offset);
// verify if report with current id has been scheduled for this frame and slot
if ((n_slots_frame*frame + slot - offset)%period == 0) {
- reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type;
+ reportQuantity_type = csi_report->reportQuantity_type;
LOG_D(MAC,"SFN/SF:%d/%d reportQuantity type = %d\n",frame,slot,reportQuantity_type);
switch(reportQuantity_type){
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP:
@@ -1011,18 +1314,49 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
evaluate_rsrp_report(UE_info,sched_ctrl,UE_id,csi_report_id,payload,&cumul_bits,reportQuantity_type);
break;
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
- cri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cri_bitlen;
+ cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
if(cri_bitlen)
evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
cumul_bits += cri_bitlen;
- ri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen;
+ ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
if(ri_bitlen)
- evaluate_ri_report(payload,ri_bitlen,sched_ctrl);
+ r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
cumul_bits += ri_bitlen;
- //TODO add zero padding bits when needed
- cqi_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen;
- if(cqi_bitlen)
- evaluate_cqi_report(payload,cqi_bitlen,&cumul_bits,sched_ctrl);
+ if (r_index != -1)
+ skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
+ evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
+ break;
+ case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI:
+ cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
+ if(cri_bitlen)
+ evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
+ cumul_bits += cri_bitlen;
+ ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
+ if(ri_bitlen)
+ r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
+ cumul_bits += ri_bitlen;
+ if (r_index != -1)
+ skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
+ pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
+ cumul_bits += pmi_bitlen;
+ evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
+ break;
+ case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI:
+ cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
+ if(cri_bitlen)
+ evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
+ cumul_bits += cri_bitlen;
+ ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
+ if(ri_bitlen)
+ r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
+ cumul_bits += ri_bitlen;
+ li_bitlen = evaluate_li_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
+ cumul_bits += li_bitlen;
+ if (r_index != -1)
+ skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
+ pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
+ cumul_bits += pmi_bitlen;
+ evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
break;
default:
AssertFatal(1==0, "Invalid or not supported CSI measurement report\n");
@@ -1184,21 +1518,25 @@ int nr_acknack_scheduling(int mod_id,
int r_pucch,
int is_common) {
- const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
- const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
- const NR_TDD_UL_DL_Pattern_t *tdd = &scc->tdd_UL_DL_ConfigurationCommon->pattern1;
- const int nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
- const int nr_slots_period = tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots;
- const int first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period);
- const int first_ul_slot_period = tdd->nrofDownlinkSlots;
const int CC_id = 0;
- NR_sched_pucch_t *csi_pucch;
+ const int minfbtime = RC.nrmac[mod_id]->minRXTXTIMEpdsch;
+ const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels[CC_id].ServingCellConfigCommon;
+ const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+ // initializing the values for FDD
+ int nr_slots_period = n_slots_frame;
+ int first_ul_slot_tdd = slot + minfbtime;
+ int first_ul_slot_period = 0;
+ if(tdd){
+ nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ first_ul_slot_tdd = tdd->nrofDownlinkSlots + nr_slots_period * (slot / nr_slots_period);
+ first_ul_slot_period = tdd->nrofDownlinkSlots;
+ }
+ else
+ // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration
+ AssertFatal(RC.nrmac[mod_id]->common_channels[CC_id].frame_type == FDD,"Dynamic TDD not handled yet\n");
- AssertFatal(slot < first_ul_slot_tdd + (tdd->nrofUplinkSymbols != 0),
- "cannot handle multiple TDD periods (yet): slot %d first_ul_slot_tdd %d nrofUplinkSlots %ld\n",
- slot,
- first_ul_slot_tdd,
- tdd->nrofUplinkSlots);
+ NR_sched_pucch_t *csi_pucch;
/* for the moment, we consider:
* * only pucch_sched[0] holds HARQ (and SR)
@@ -1208,19 +1546,21 @@ int nr_acknack_scheduling(int mod_id,
* * each UE has dedicated PUCCH Format 0 resources, and we use index 0! */
NR_UE_sched_ctrl_t *sched_ctrl = &RC.nrmac[mod_id]->UE_info.UE_sched_ctrl[UE_id];
NR_sched_pucch_t *pucch = &sched_ctrl->sched_pucch[0];
- LOG_D(NR_MAC,"pucch_acknak %d.%d Trying to allocate pucch, current DAI %d\n",frame,slot,pucch->dai_c);
+ LOG_D(NR_MAC, "In %s: %d.%d Trying to allocate pucch, current DAI %d\n", __FUNCTION__, frame, slot, pucch->dai_c);
+
pucch->r_pucch=r_pucch;
AssertFatal(pucch->csi_bits == 0,
"%s(): csi_bits %d in sched_pucch[0]\n",
__func__,
pucch->csi_bits);
+
/* if the currently allocated PUCCH of this UE is full, allocate it */
if (pucch->dai_c == 2) {
/* advance the UL slot information in PUCCH by one so we won't schedule in
* the same slot again */
const int f = pucch->frame;
const int s = pucch->ul_slot;
- LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n",frame,slot,f,s);
+ LOG_D(NR_MAC, "In %s: %d.%d DAI = 2 pucch currently in %d.%d, advancing by 1 slot\n", __FUNCTION__, frame, slot, f, s);
nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id);
memset(pucch, 0, sizeof(*pucch));
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
@@ -1247,7 +1587,7 @@ int nr_acknack_scheduling(int mod_id,
}
}
- LOG_D(NR_MAC,"pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
+ LOG_D(NR_MAC, "In %s: pucch_acknak 1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame, slot, pucch->frame, pucch->ul_slot, pucch->dai_c);
// this is hardcoded for now as ue specific only if we are not on the initialBWP (to be fixed to allow ue_Specific also on initialBWP
NR_CellGroupConfig_t *cg = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id];
@@ -1268,7 +1608,7 @@ int nr_acknack_scheduling(int mod_id,
int max_fb_time = 0;
get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, &max_fb_time, pdsch_to_harq_feedback);
- LOG_D(NR_MAC,"pucch_acknak 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
+ LOG_D(NR_MAC, "In %s: 1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
/* there is a HARQ. Check whether we can use it for this ACKNACK */
if (pucch->dai_c > 0) {
/* this UE already has a PUCCH occasion */
@@ -1278,7 +1618,8 @@ int nr_acknack_scheduling(int mod_id,
int diff = pucch->ul_slot - slot;
if (diff<0)
diff += n_slots_frame;
- if (pdsch_to_harq_feedback[i] == diff)
+ if (pdsch_to_harq_feedback[i] == diff &&
+ pdsch_to_harq_feedback[i] >= minfbtime)
break;
++i;
}
@@ -1287,7 +1628,7 @@ int nr_acknack_scheduling(int mod_id,
const int f = pucch->frame;
const int s = pucch->ul_slot;
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
- LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n",frame,slot,f,s);
+ LOG_D(NR_MAC, "In %s: %d.%d DAI > 0, cannot reach timing for pucch in %d.%d, advancing slot by 1 and trying again\n", __FUNCTION__, frame, slot, f, s);
nr_fill_nfapi_pucch(mod_id, frame, slot, pucch, UE_id);
memset(pucch, 0, sizeof(*pucch));
pucch->frame = s == n_slots_frame - 1 ? (f + 1) % 1024 : f;
@@ -1301,11 +1642,11 @@ int nr_acknack_scheduling(int mod_id,
pucch->timing_indicator = i;
pucch->dai_c++;
// retain old resource indicator, and we are good
- LOG_D(NR_MAC,"pucch_acknak : %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
+ LOG_D(NR_MAC, "In %s: %d.%d. DAI > 0, pucch allocated for %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
return 0;
}
- LOG_D(NR_MAC,"pucch_acknak : %d.%d DAI = 0, looking for new pucch occasion\n",frame,slot);
+ LOG_D(NR_MAC, "In %s: %d.%d DAI = 0, looking for new pucch occasion\n", __FUNCTION__, frame, slot);
/* we need to find a new PUCCH occasion */
/*(Re)Inizialization of timing information*/
@@ -1315,8 +1656,9 @@ int nr_acknack_scheduling(int mod_id,
AssertFatal(pucch->sr_flag + pucch->dai_c == 0,
"expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n",
UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
- pucch->frame = frame;
- pucch->ul_slot = first_ul_slot_tdd;
+ const int s = first_ul_slot_tdd;
+ pucch->frame = (s < n_slots_frame - 1) ? frame : (frame + 1) % 1024;
+ pucch->ul_slot = s % n_slots_frame;
}
// Find the right timing_indicator value.
@@ -1325,12 +1667,13 @@ int nr_acknack_scheduling(int mod_id,
while ((n_slots_frame + pucch->ul_slot - slot) % n_slots_frame <= max_fb_time) {
int i = 0;
while (i < 8) {
- LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n",
+ LOG_D(NR_MAC, "In %s: pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", __FUNCTION__,
i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot);
int diff = pucch->ul_slot - slot;
if (diff<0)
diff += n_slots_frame;
- if (pdsch_to_harq_feedback[i] == diff) {
+ if (pdsch_to_harq_feedback[i] == diff &&
+ pdsch_to_harq_feedback[i] >= minfbtime) {
ind_found = i;
break;
}
@@ -1393,7 +1736,7 @@ int nr_acknack_scheduling(int mod_id,
pucch->timing_indicator = ind_found; // index in the list of timing indicators
- LOG_D(NR_MAC,"pucch_acknak 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
+ LOG_D(NR_MAC, "In %s: 2. DAI 0 DL %d.%d, UL_ACK %d.%d (index %d)\n", __FUNCTION__, frame,slot,pucch->frame,pucch->ul_slot,pucch->timing_indicator);
pucch->dai_c++;
pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources
diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
index 0a18731c0a..34d4496eee 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
@@ -60,11 +60,23 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
/* there is a mixed slot only when in TDD */
NR_ServingCellConfigCommon_t *scc = nrmac->common_channels->ServingCellConfigCommon;
+ lte_frame_type_t frame_type = nrmac->common_channels->frame_type;
+ const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
const int mu = scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.subcarrierSpacing;
const NR_TDD_UL_DL_Pattern_t *tdd =
scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
/* Uplink symbols are at the end of the slot */
- const int symb_ulMixed = tdd ? ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols) : 0;
+ int symb_ulMixed = 0;
+ int nr_mix_slots = 0;
+ int nr_slots_period = n;
+ if (tdd) {
+ symb_ulMixed = ((1 << tdd->nrofUplinkSymbols) - 1) << (14 - tdd->nrofUplinkSymbols);
+ nr_mix_slots = tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0;
+ nr_slots_period /= get_nb_periods_per_frame(tdd->dl_UL_TransmissionPeriodicity);
+ }
+ else
+ // if TDD configuration is not present and the band is not FDD, it means it is a dynamic TDD configuration
+ AssertFatal(nrmac->common_channels->frame_type == FDD,"Dynamic TDD not handled yet\n");
const struct NR_PUCCH_Config__resourceToAddModList *resList = ubwp->bwp_Dedicated->pucch_Config->choice.setup->resourceToAddModList;
// for the moment, just block any symbol that might hold a PUCCH, regardless
@@ -117,7 +129,7 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
// get largest time domain allocation (TDA) for UL slot and UL in mixed slot
int tdaMi = -1;
- if(tdaList->list.count > 1) {
+ if (nr_mix_slots>0) {
const NR_PUSCH_TimeDomainResourceAllocation_t *tdaP_Mi = tdaList->list.array[1];
AssertFatal(k2 == get_K2(scc, (NR_BWP_Uplink_t*)ubwp, 1, mu),
"scheduler cannot handle different k2 for UL slot (%d) and UL Mixed slot (%ld)\n",
@@ -139,27 +151,25 @@ void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ub
symb_tda_mi);
}
}
- const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160};
- const int n = slots_per_frame[*scc->ssbSubcarrierSpacing];
+
nrmac->preferred_ul_tda[bwp_id] = malloc(n * sizeof(*nrmac->preferred_ul_tda[bwp_id]));
- const int nr_mix_slots = tdd ? tdd->nrofDownlinkSymbols != 0 || tdd->nrofUplinkSymbols != 0 : 0;
- const int nr_slots_period = tdd ? tdd->nrofDownlinkSlots + tdd->nrofUplinkSlots + nr_mix_slots : n;
for (int slot = 0; slot < n; ++slot) {
const int sched_slot = (slot + k2) % n;
nrmac->preferred_ul_tda[bwp_id][slot] = -1;
- if (!tdd || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots)
+ if (frame_type == FDD || sched_slot % nr_slots_period >= tdd->nrofDownlinkSlots + nr_mix_slots)
nrmac->preferred_ul_tda[bwp_id][slot] = 0;
- else if (tdd && nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots)
+ else if (nr_mix_slots && sched_slot % nr_slots_period == tdd->nrofDownlinkSlots)
nrmac->preferred_ul_tda[bwp_id][slot] = tdaMi;
LOG_D(MAC, "DL slot %d UL slot %d preferred_ul_tda %d\n", slot, sched_slot, nrmac->preferred_ul_tda[bwp_id][slot]);
}
- if (k2 < tdd->nrofUplinkSlots)
+ if (tdd && k2 < tdd->nrofUplinkSlots) {
LOG_W(NR_MAC,
"k2 %d < tdd->nrofUplinkSlots %ld: not all UL slots can be scheduled\n",
k2,
tdd->nrofUplinkSlots);
+ }
}
// For both UL-SCH except:
@@ -710,7 +720,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt++;
UE_info->mac_stats[UE_id].ulsch_DTX++;
}
- if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) {
+ if (!get_softmodem_params()->phy_test && UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) {
LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n",
UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt);
UE_info->UE_sched_ctrl[UE_id].ul_failure = 1;
@@ -903,8 +913,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc,NR_BWP_Uplink_t *ubwp, int time_do
bool nr_UE_is_to_be_scheduled(module_id_t mod_id, int CC_id, int UE_id, frame_t frame, sub_frame_t slot)
{
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_id]->common_channels->ServingCellConfigCommon;
- const uint8_t slots_per_frame[5] = {10, 20, 40, 80, 160};
- const int n = slots_per_frame[*scc->ssbSubcarrierSpacing];
+ const int n = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
const int now = frame * n + slot;
const struct gNB_MAC_INST_s *nrmac = RC.nrmac[mod_id];
@@ -1001,9 +1010,11 @@ bool allocate_ul_retransmission(module_id_t module_id,
uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm,
retInfo->R,
+ 1, // layers
temp_ps.nrOfSymbols,
temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb,
retInfo->tb_size,
+ 1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */
rbSize,
&new_tbs,
&new_rbSize);
@@ -1256,8 +1267,9 @@ void pf_ul(module_id_t module_id,
}
+ const int min_rbSize = 5;
/* Loop UE_sched to find max coeff and allocate transmission */
- while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched > 0) {
+ while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched >= min_rbSize) {
/* Find max coeff */
int *max = &UE_sched.head; /* Find max coeff: assume head is max */
int *p = &UE_sched.next[*max];
@@ -1303,8 +1315,7 @@ void pf_ul(module_id_t module_id,
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
max_num_ue--;
- if (max_num_ue < 0)
- return;
+ AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue);
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
@@ -1346,9 +1357,11 @@ void pf_ul(module_id_t module_id,
uint32_t TBS = 0;
nr_find_nb_rb(sched_pusch->Qm,
sched_pusch->R,
+ 1, // layers
ps->nrOfSymbols,
ps->N_PRB_DMRS * ps->num_dmrs_symb,
B,
+ min_rbSize,
max_rbSize,
&TBS,
&rbSize);
@@ -1401,8 +1414,13 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
if (!is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot))
return false;
- bool is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) &&
- is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot);
+ bool is_mixed_slot = false;
+ const NR_TDD_UL_DL_Pattern_t *tdd =
+ scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+
+ if (tdd)
+ is_mixed_slot = is_xlsch_in_slot(nr_mac->dlsch_slot_bitmap[sched_slot / 64], sched_slot) &&
+ is_xlsch_in_slot(nr_mac->ulsch_slot_bitmap[sched_slot / 64], sched_slot);
// FIXME: Avoid mixed slots for initialUplinkBWP
if (sched_ctrl->active_ubwp==NULL && is_mixed_slot)
diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
index 9afd2a4083..28e9d689fa 100644
--- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
@@ -50,10 +50,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
int pdsch_AntennaPorts,
int pusch_AntennaPorts,
int sib1_tda,
+ int minRXTXTIMEpdsch,
NR_ServingCellConfigCommon_t *scc,
NR_BCCH_BCH_Message_t *mib,
- int add_ue,
- uint32_t rnti,
+ int add_ue,
+ uint32_t rnti,
NR_CellGroupConfig_t *CellGroup);
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
@@ -244,7 +245,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
uint16_t O_csi,
uint16_t O_ack,
uint8_t O_sr,
- int r_pucch);
+ int r_pucch);
void find_search_space(int ss_type,
NR_BWP_Downlink_t *bwp,
@@ -309,7 +310,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
const NR_BWP_Downlink_t *bwp,
const NR_BWP_DownlinkDedicated_t *bwpd0,
int tda,
- const long dci_format,
+ uint8_t layers,
+ NR_UE_sched_ctrl_t *sched_ctrl,
NR_pdsch_semi_static_t *ps);
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
@@ -349,6 +351,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
/* Functions to manage an NR_list_t */
void dump_nr_list(NR_list_t *listP);
void create_nr_list(NR_list_t *listP, int len);
+void resize_nr_list(NR_list_t *list, int new_len);
void destroy_nr_list(NR_list_t *list);
void add_nr_list(NR_list_t *listP, int id);
void remove_nr_list(NR_list_t *listP, int id);
@@ -453,6 +456,13 @@ void find_SSB_and_RO_available(module_id_t module_idP);
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps);
+void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
+ NR_UE_sched_ctrl_t *sched_ctrl,
+ uint8_t *target_mcs,
+ uint8_t mcs_table_idx);
+
+uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl);
+
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp);
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);
@@ -460,9 +470,11 @@ bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id);
bool nr_find_nb_rb(uint16_t Qm,
uint16_t R,
+ uint8_t nrOfLayers,
uint16_t nb_symb_sch,
uint16_t nb_dmrs_prb,
uint32_t bytes,
+ uint16_t nb_rb_min,
uint16_t nb_rb_max,
uint32_t *tbs,
uint16_t *nb_rb);
diff --git a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
index 5b3fb91eb7..22a0932c3f 100644
--- a/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+++ b/openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
@@ -391,7 +391,8 @@ typedef struct NR_sched_srs {
typedef struct NR_pdsch_semi_static {
int time_domain_allocation;
uint8_t numDmrsCdmGrpsNoData;
-
+ uint8_t frontloaded_symb;
+ int mapping_type;
int startSymbolIndex;
int nrOfSymbols;
uint8_t nrOfLayers;
@@ -477,6 +478,7 @@ struct CRI_RI_LI_PMI_CQI {
uint8_t pmi_x2;
uint8_t wb_cqi_1tb;
uint8_t wb_cqi_2tb;
+ uint8_t cqi_table;
};
typedef struct CRI_SSB_RSRP {
@@ -487,11 +489,8 @@ typedef struct CRI_SSB_RSRP {
} CRI_SSB_RSRP_t;
struct CSI_Report {
- NR_CSI_Report_Config_PR present;
- union Config_CSI_Report {
- struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report;
- struct CRI_SSB_RSRP ssb_cri_report;
- } choice;
+ struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report;
+ struct CRI_SSB_RSRP ssb_cri_report;
};
#define MAX_SR_BITLEN 8
@@ -504,12 +503,13 @@ typedef struct {
}L1_RSRP_bitlen_t;
typedef struct{
+ uint8_t ri_restriction;
uint8_t cri_bitlen;
uint8_t ri_bitlen;
- uint8_t li_bitlen;
- uint8_t pmi_x1_bitlen;
- uint8_t pmi_x2_bitlen;
- uint8_t cqi_bitlen;
+ uint8_t li_bitlen[8];
+ uint8_t pmi_x1_bitlen[8];
+ uint8_t pmi_x2_bitlen[8];
+ uint8_t cqi_bitlen[8];
} CSI_Meas_bitlen_t;
typedef struct nr_csi_report {
@@ -618,9 +618,9 @@ typedef struct {
int pusch_consecutive_dtx_cnt;
int pucch_consecutive_dtx_cnt;
int ul_failure;
- struct CSI_Report CSI_report[MAX_CSI_REPORTS];
+ struct CSI_Report CSI_report;
bool SR;
-
+ bool set_mcs;
/// information about every HARQ process
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
/// HARQ processes that are free
@@ -673,7 +673,6 @@ typedef struct {
NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB];
NR_list_t list;
int num_UEs;
-
bool active[MAX_MOBILES_PER_GNB];
rnti_t rnti[MAX_MOBILES_PER_GNB];
NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB];
@@ -717,6 +716,7 @@ typedef struct gNB_MAC_INST_s {
int ssb_SubcarrierOffset;
/// SIB1 Time domain allocation
int sib1_tda;
+ int minRXTXTIMEpdsch;
/// Common cell resources
NR_COMMON_channels_t common_channels[NFAPI_CC_MAX];
/// current PDU index (BCH,DLSCH)
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index 4d2e157728..108a5dbe91 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -48,7 +48,6 @@
#include "platform_constants.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "msc.h"
#include "common/ngran_types.h"
#include "targets/COMMON/openairinterface5g_limits.h"
#include "targets/RT/USER/lte-softmodem.h"
@@ -60,7 +59,6 @@
#include
# include "gtpv1u_eNB_task.h"
-# include "gtpv1u.h"
#include
#include "ENB_APP/enb_config.h"
@@ -229,7 +227,7 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt,
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
- itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p);
+ itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
return TRUE;
}
@@ -1058,14 +1056,6 @@ pdcp_data_ind(
ctxt_pP->rnti,
rb_id + 4,
sdu_buffer_sizeP - payload_offset );
- MSC_LOG_TX_MESSAGE(
- MSC_PDCP_ENB,
- MSC_GTPU_ENB,
- NULL,0,
- "0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
- ctxt_pP->rnti,
- rb_id + 4,
- sdu_buffer_sizeP - payload_offset);
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
@@ -1078,7 +1068,7 @@ pdcp_data_ind(
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
- itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
+ itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
packet_forwarded = TRUE;
}
} else {
@@ -2228,20 +2218,6 @@ pdcp_config_set_security(
pdcp_pP->kUPenc = kUPenc;
/* Activate security */
pdcp_pP->security_activated = 1;
- MSC_LOG_EVENT(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- "0 Set security ciph %X integ %x UE %"PRIx16" ",
- pdcp_pP->cipheringAlgorithm,
- pdcp_pP->integrityProtAlgorithm,
- ctxt_pP->rnti);
- } else {
- MSC_LOG_EVENT(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- "0 Set security failed UE %"PRIx16" ",
- ctxt_pP->rnti);
- LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d",
- PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
- security_modeP);
}
}
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index b49b020428..f6a61330d0 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -58,7 +58,6 @@ extern int otg_enabled;
#include "nfapi/oai_integration/vendor_ext.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "platform_constants.h"
-#include "msc.h"
#include "pdcp.h"
#include "assertions.h"
@@ -85,8 +84,6 @@ extern struct msghdr nas_msg_rx;
# include "gtpv1u_eNB_task.h"
-# include "gtpv1u_eNB_defs.h"
-
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c
@@ -343,12 +340,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n",
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
ctxt.rnti, rab_id);
- MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL, 0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- ctxt.instance, rab_id, rab_id, len);
pdcp_data_req(
&ctxt,
SRB_FLAG_NO,
@@ -368,14 +359,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
// , NULL, NULL
// );
} else {
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- ctxt.instance, rab_id, rab_id, len);
LOG_D(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %04x][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
@@ -566,17 +549,6 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
);
} else { /* else of h_rc == HASH_TABLE_OK */
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- pdcp_read_header_g.inst,
- pdcp_read_header_g.rb_id,
- rab_id,
- pdcp_read_header_g.data_size);
LOG_D(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame,
@@ -739,17 +711,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
ctxt.module_id,
ctxt.rnti,
rab_id);
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- pc5s_header->inst,
- pc5s_header->rb_id,
- rab_id,
- pc5s_header->data_size);
/* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure
* Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and
* gcc, from v9, now warns about it. fix these warnings by using local variables
@@ -771,17 +732,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
pc5s_header->sourceL2Id = sourceL2Id;
pc5s_header->destinationL2Id=destinationL2Id;
} else { /* else of h_rc == HASH_TABLE_OK */
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- pc5s_header->inst,
- pc5s_header->rb_id,
- rab_id,
- pc5s_header->data_size);
LOG_D(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame,
@@ -803,16 +753,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
ctxt.module_id,
ctxt.rnti,
DEFAULT_RAB_ID);
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
- NULL,0,
- MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- pc5s_header->inst,
- pc5s_header->rb_id,
- DEFAULT_RAB_ID,
- pc5s_header->data_size);
/* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure
* Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and
* gcc, from v9, now warns about it. fix these warnings by using local variables
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
index 891c38209b..0bd1b8fa8d 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
@@ -60,7 +60,6 @@
#include "pdcp.h"
#include "pdcp_primitives.h"
-#include "msc.h"
#define PDCP_QUEUE_NB_ELEMENTS 200
@@ -187,7 +186,6 @@ void *pdcp_netlink_thread_fct(void *arg)
pdcp_thread_read_state = 0;
memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
- MSC_START_USE();
while (1) {
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
index cb108f5d26..6664dd2a33 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_security.c
@@ -37,7 +37,6 @@
#include "LAYER2/MAC/mac_extern.h"
#include "pdcp.h"
-#include "msc.h"
#include "pdcp_primitives.h"
//-----------------------------------------------------------------------------
@@ -223,11 +222,6 @@ pdcp_validate_security(
if (stream_check_integrity(pdcp_pP->integrityProtAlgorithm,
&decrypt_params,
&pdcp_pdu_buffer[sdu_buffer_size]) != 0) {
- MSC_LOG_EVENT(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- " Security: failed MAC-I Algo %X UE %"PRIx16" ",
- pdcp_pP->integrityProtAlgorithm,
- ctxt_pP->rnti);
LOG_E(PDCP, "[OSA][RB %ld] %s failed to validate MAC-I (key %llx) of incoming PDU\n",
rb_id, (pdcp_pP->is_ue != 0) ? "UE" : "eNB",((long long unsigned int*)decrypt_params.key)[0]);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT);
diff --git a/openair2/LAYER2/PROTO_AGENT/cu_test.c b/openair2/LAYER2/PROTO_AGENT/cu_test.c
deleted file mode 100644
index a26b06dd41..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/cu_test.c
+++ /dev/null
@@ -1,172 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "ENB_APP/enb_paramdef.h"
-#include "LAYER2/PROTO_AGENT/proto_agent.h"
-#define BUF_MAX 1400
-
-int recv_client = 0;
-FILE *output;
-
-void usage(char *prg_name) {
- fprintf(stderr, "usage: %s \n", prg_name);
- fprintf(stderr, " - is stdin\n");
- fprintf(stderr, " received packets are written to stdout\n");
-}
-
-long uelapsed(struct timeval *s, struct timeval *e) {
- return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec);
-}
-
-boolean_t
-pdcp_data_ind(
- const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP,
- const sdu_size_t sdu_buffer_sizeP,
- mem_block_t *const sdu_buffer_pP
-) {
- fwrite(sdu_buffer_pP->data, sdu_buffer_sizeP, 1, stdout);
- fflush(stdout);
- free_mem_block(sdu_buffer_pP, __func__);
- /* cannot free because of const */
- //free(ctxt_pP);
- recv_client = 1;
- return 0;
-}
-
-void close_proto_agent(void) {
- proto_agent_stop(0);
-}
-
-int main(int argc, char *argv[]) {
- const cudu_params_t params = {
- .local_ipv4_address = "192.168.12.45",
- .local_port = 6464,
- .remote_ipv4_address = "192.168.12.45",
- .remote_port = 6465
- };
- protocol_ctxt_t p;
- memset(&p, 0, sizeof p);
- mem_block_t mem;
- char s[BUF_MAX];
- size_t size, totsize = 0;
- struct timeval t_start, t_end;
- FILE *f;
-
- if (argc != 2) {
- usage(argv[0]);
- return 1;
- }
-
- if (strcmp(argv[1], "-") == 0) {
- f = stdin;
- } else {
- f = fopen(argv[1], "r");
- }
-
- if (!f) {
- fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno));
- return 2;
- }
-
- pool_buffer_init();
-
- if (proto_agent_start(0, ¶ms) != 0) {
- fprintf(stderr, "error on proto_agent_start()\n");
- fclose(f);
- return 3;
- }
-
- atexit(close_proto_agent);
-
- /* wait for first packet of client */
- while (!recv_client) sleep(1);
-
- fprintf(stderr, "reading file\n");
- /* now send back at the same time */
- gettimeofday(&t_start, NULL);
-
- while ((size = fread(s, 1, BUF_MAX, f)) > 0) {
- usleep(10);
- totsize += size;
- mem.data = &s[0];
- proto_agent_send_rlc_data_req(&p, 0, 0, 0, 0, 0, size, &mem);
- }
-
- gettimeofday(&t_end, NULL);
- fclose(f);
- long us = uelapsed(&t_start, &t_end);
- fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n",
- totsize, us / 1000, ((float) totsize ) / us,
- ((float) totsize) / us * 8);
- fprintf(stderr, "check files using 'diff afile bfile'\n");
- /* give some time in case the other direction is slower */
- sleep(5);
- return 0;
-}
-
-/*
- *********************************************************
- * arbitrary functions, needed for linking (used or not) *
- *********************************************************
- */
-
-rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP,
- const mui_t muiP,
- confirm_t confirmP,
- sdu_size_t sdu_sizeP,
- mem_block_t *sdu_pP,
- const uint32_t *const sourceL2Id,
- const uint32_t *const destinationL2Id
- ) {
- fprintf(stderr, "This should never be called on the CU\n");
- exit(1);
-}
-
-pthread_t new_thread(void *(*f)(void *), void *b) {
- pthread_t t;
- pthread_attr_t att;
-
- if (pthread_attr_init(&att)) {
- fprintf(stderr, "pthread_attr_init err\n");
- exit(1);
- }
-
- if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
- fprintf(stderr, "pthread_attr_setdetachstate err\n");
- exit(1);
- }
-
- if (pthread_create(&t, &att, f, b)) {
- fprintf(stderr, "pthread_create err\n");
- exit(1);
- }
-
- if (pthread_attr_destroy(&att)) {
- fprintf(stderr, "pthread_attr_destroy err\n");
- exit(1);
- }
-
- return t;
-}
-
-int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
- return 0;
-}
-
-int config_get(paramdef_t *params,int numparams, char *prefix) {
- return 0;
-}
-
-int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
- return 0;
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/du_test.c b/openair2/LAYER2/PROTO_AGENT/du_test.c
deleted file mode 100644
index ee62298438..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/du_test.c
+++ /dev/null
@@ -1,163 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "ENB_APP/enb_paramdef.h"
-#include "LAYER2/PROTO_AGENT/proto_agent.h"
-
-#define BUF_MAX 1400
-
-void usage(char *prg_name) {
- fprintf(stderr, "usage: %s \n", prg_name);
- fprintf(stderr, " - is stdin\n");
- fprintf(stderr, " received packets are written to stdout\n");
-}
-
-long uelapsed(struct timeval *s, struct timeval *e) {
- return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec);
-}
-
-
-rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP,
- const mui_t muiP,
- confirm_t confirmP,
- sdu_size_t sdu_sizeP,
- mem_block_t *sdu_pP,
- const uint32_t *const sourceL2Id,
- const uint32_t *const destinationL2Id
- ) {
- fwrite(sdu_pP->data, sdu_sizeP, 1, stdout);
- fflush(stdout);
- free_mem_block(sdu_pP, __func__);
- //free(ctxt_pP);
- return 0;
-}
-
-void close_proto_agent(void) {
- proto_agent_stop(0);
-}
-
-int main(int argc, char *argv[]) {
- const cudu_params_t params = {
- .local_ipv4_address = "192.168.12.45",
- .local_port = 6465,
- .remote_ipv4_address = "192.168.12.45",
- .remote_port = 6464
- };
- protocol_ctxt_t p;
- memset(&p, 0, sizeof p);
- mem_block_t mem;
- char s[BUF_MAX];
- size_t size, totsize = 0;
- struct timeval t_start, t_end;
- FILE *f;
-
- if (argc != 2) {
- usage(argv[0]);
- return 1;
- }
-
- if (strcmp(argv[1], "-") == 0) {
- f = stdin;
- } else {
- f = fopen(argv[1], "r");
- }
-
- if (!f) {
- fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno));
- return 2;
- }
-
- pool_buffer_init();
-
- if (proto_agent_start(0, ¶ms) != 0) {
- fprintf(stderr, "error on proto_agent_start()\n");
- fclose(f);
- return 3;
- }
-
- atexit(close_proto_agent);
- gettimeofday(&t_start, NULL);
-
- while ((size = fread(s, 1, BUF_MAX, f)) > 0) {
- usleep(10);
- totsize += size;
- mem.data = &s[0];
- proto_agent_send_pdcp_data_ind(&p, 0, 0, 0, size, &mem);
- }
-
- gettimeofday(&t_end, NULL);
- fclose(f);
- long us = uelapsed(&t_start, &t_end);
- fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n",
- totsize, us / 1000, ((float) totsize ) / us,
- ((float) totsize) / us * 8);
- fprintf(stderr, "check files using 'diff afile bfile'\n");
- /* wait, we are possibly receiving data */
- sleep(5);
- return 0;
-}
-
-/*
- *********************************************************
- * arbitrary functions, needed for linking (used or not) *
- *********************************************************
- */
-
-boolean_t
-pdcp_data_ind(
- const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP,
- const sdu_size_t sdu_buffer_sizeP,
- mem_block_t *const sdu_buffer_pP
-) {
- fprintf(stderr, "This should never be called on the DU\n");
- exit(1);
-}
-
-pthread_t new_thread(void *(*f)(void *), void *b) {
- pthread_t t;
- pthread_attr_t att;
-
- if (pthread_attr_init(&att)) {
- fprintf(stderr, "pthread_attr_init err\n");
- exit(1);
- }
-
- if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
- fprintf(stderr, "pthread_attr_setdetachstate err\n");
- exit(1);
- }
-
- if (pthread_create(&t, &att, f, b)) {
- fprintf(stderr, "pthread_create err\n");
- exit(1);
- }
-
- if (pthread_attr_destroy(&att)) {
- fprintf(stderr, "pthread_attr_destroy err\n");
- exit(1);
- }
-
- return t;
-}
-
-int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
- return 0;
-}
-
-int config_get(paramdef_t *params,int numparams, char *prefix) {
- return 0;
-}
-
-int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
- return 0;
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.c b/openair2/LAYER2/PROTO_AGENT/proto_agent.c
deleted file mode 100644
index 5cf71b826d..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * 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 enb_agent.h
- * \brief top level enb agent receive thread and itti task
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-#define _GNU_SOURCE
-#include "proto_agent_common.h"
-#include "common/utils/LOG/log.h"
-#include "proto_agent.h"
-#include "assertions.h"
-#include "proto_agent_net_comm.h"
-#include "proto_agent_async.h"
-#include
-#include
-
-#define ENB_AGENT_MAX 9
-
-proto_agent_instance_t proto_agent[MAX_DU];
-
-//pthread_t new_thread(void *(*f)(void *), void *b);
-
-Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args);
-
-#define TEST_MOD 0
-
-#define ECHO
-
-/* Server side function; upon a new connection
- reception, sends the hello packets
-*/
-int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
- int channel_id;
- // RS: CUDU does not work!
- //DevAssert(p->local_interface);
- //DevAssert(p->local_ipv4_address);
- //DevAssert(p->local_port > 1024); // "unprivileged" port
- //DevAssert(p->remote_ipv4_address);
- //DevAssert(p->remote_port > 1024); // "unprivileged" port
- proto_agent[mod_id].mod_id = mod_id;
- proto_agent[mod_id].exit = 0;
- /* Initialize the channel container */
- /* TODO only initialize the first time */
- proto_agent_init_channel_container();
- /*Create the async channel info*/
- proto_agent_async_channel_t *channel_info;
- channel_info = proto_agent_async_channel_info(mod_id, p->local_ipv4_address, p->local_port,
- p->remote_ipv4_address, p->remote_port);
-
- if (!channel_info) goto error;
-
- /* Create a channel using the async channel info */
- channel_id = proto_agent_create_channel((void *) channel_info,
- proto_agent_async_msg_send,
- proto_agent_async_msg_recv,
- proto_agent_async_release);
-
- if (channel_id <= 0) goto error;
-
- proto_agent_channel_t *channel = proto_agent_get_channel(channel_id);
-
- if (!channel) goto error;
-
- proto_agent[mod_id].channel = channel;
- /* Register the channel for all underlying agents (use ENB_AGENT_MAX) */
- proto_agent_register_channel(mod_id, channel, ENB_AGENT_MAX);
- // Code for sending the HELLO/ECHO_REQ message once a connection is established
- //uint8_t *msg = NULL;
- //Protocol__FlexsplitMessage *init_msg=NULL;
- //if (udp == 0)
- //{
- // // If the comm is not UDP, allow the server to send the first packet over the channel
- // //printf( "Proto agent Server: Calling the echo_request packet constructor\n");
- // msg_flag = proto_agent_echo_request(mod_id, NULL, &init_msg);
- // if (msg_flag != 0)
- // goto error;
- //
- // int msgsize = 0;
- // if (init_msg != NULL)
- // msg = proto_agent_pack_message(init_msg, &msgsize);
- // if (msg!= NULL)
- // {
- // LOG_D(PROTO_AGENT, "Server sending the message over the async channel\n");
- // proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) channel_info);
- // }
- // /* After sending the message, wait for any replies;
- // the server thread blocks until it reads any data
- // over the channel
- // */
- //}
- //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:
- LOG_E(PROTO_AGENT, "there was an error\n");
- return 1;
-}
-
-void proto_agent_stop(mod_id_t mod_id) {
- if (!proto_agent[mod_id].channel) return;
-
- /* unlock the independent read thread proto_agent_receive() */
- proto_agent[mod_id].exit = 1;
- proto_agent_async_msg_recv_unlock(proto_agent[mod_id].channel->channel_info);
- proto_agent_async_release(proto_agent[mod_id].channel);
- proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id);
- free(proto_agent[mod_id].channel);
- proto_agent[mod_id].channel = NULL;
- LOG_W(PROTO_AGENT, "server stopped\n");
-}
-
-//void
-//proto_agent_send_hello(void)
-//{
-// uint8_t *msg = NULL;
-// Protocol__FlexsplitMessage *init_msg=NULL;
-// int msg_flag = 0;
-//
-//
-// //printf( "PDCP agent: Calling the HELLO packet constructor\n");
-// msg_flag = proto_agent_hello(proto_agent[TEST_MOD].mod_id, NULL, &init_msg);
-//
-// int msgsize = 0;
-// if (msg_flag == 0)
-// {
-// proto_agent_serialize_message(init_msg, &msg, &msgsize);
-// }
-//
-// LOG_D(PROTO_AGENT, "Agent sending the message over the async channel\n");
-// proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) client_channel[TEST_MOD]);
-//}
-
-
-
-rlc_op_status_t proto_agent_send_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP, const mui_t muiP,
- confirm_t confirmP, sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID) {
- uint8_t *msg = NULL;
- Protocol__FlexsplitMessage *init_msg=NULL;
- int msg_flag = 0;
- int msgsize = 0;
- mod_id_t mod_id = ctxt_pP->module_id;
- data_req_args args;
- DevAssert(proto_agent[mod_id].channel);
- DevAssert(proto_agent[mod_id].channel->channel_info);
- args.ctxt = ctxt_pP;
- args.srb_flag = srb_flagP;
- args.MBMS_flag = MBMS_flagP;
- args.rb_id = rb_idP;
- args.mui = muiP;
- args.confirm = confirmP;
- args.sdu_size = sdu_sizeP;
- args.sdu_p = sdu_pP;
- msg_flag = proto_agent_pdcp_data_req(mod_id, (void *) &args, &init_msg);
-
- if (msg_flag != 0 || !init_msg) goto error;
-
- msg = proto_agent_pack_message(init_msg, &msgsize);
-
- if (!msg) goto error;
-
- proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
- free_mem_block(sdu_pP, __func__);
- return RLC_OP_STATUS_OK;
-error:
- LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n");
- return RLC_OP_STATUS_INTERNAL_ERROR;
-}
-
-
-boolean_t proto_agent_send_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP, const srb_flag_t srb_flagP,
- const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP,
- sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,
- const uint32_t *const SrcID, const uint32_t *const DstID) {
- uint8_t *msg = NULL;
- Protocol__FlexsplitMessage *init_msg = NULL;
- int msg_flag = 0;
- int msgsize = 0;
- mod_id_t mod_id = ctxt_pP->module_id;
- data_req_args args;
- DevAssert(proto_agent[mod_id].channel);
- DevAssert(proto_agent[mod_id].channel->channel_info);
- args.ctxt = ctxt_pP;
- args.srb_flag = srb_flagP;
- args.MBMS_flag = MBMS_flagP;
- args.rb_id = rb_idP;
- args.sdu_size = sdu_sizeP;
- args.sdu_p = sdu_pP;
- msg_flag = proto_agent_pdcp_data_ind(mod_id, (void *) &args, &init_msg);
-
- if (msg_flag != 0 || !init_msg) goto error;
-
- msg = proto_agent_pack_message(init_msg, &msgsize);
-
- if (!msg) goto error;
-
- proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
- free_mem_block(sdu_pP, __func__);
- return TRUE;
-error:
- LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__);
- return FALSE;
-}
-
-void *
-proto_agent_receive(void *args) {
- proto_agent_instance_t *inst = args;
- void *data = NULL;
- int size;
- int priority;
- err_code_t err_code;
- pthread_setname_np(pthread_self(), "proto_rx");
- Protocol__FlexsplitMessage *msg;
- uint8_t *ser_msg;
-
- while (1) {
- msg = NULL;
- ser_msg = NULL;
-
- if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0) {
- err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
- goto error;
- }
-
- if (inst->exit) break;
-
- LOG_D(PROTO_AGENT, "Server side Received message with size %d and priority %d, calling message handle\n", size, priority);
- msg = proto_agent_handle_message(inst->mod_id, data, size);
-
- if (!msg) {
- LOG_D(PROTO_AGENT, "msg to send back is NULL\n");
- continue;
- }
-
- ser_msg = proto_agent_pack_message(msg, &size);
-
- if (!ser_msg) {
- continue;
- }
-
- LOG_D(PROTO_AGENT, "Server sending the reply message over the async channel\n");
-
- if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)) {
- err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
- goto error;
- }
-
- LOG_D(PROTO_AGENT, "sent message with size %d\n", size);
- }
-
- return NULL;
-error:
- LOG_E(PROTO_AGENT, "proto_agent_receive(): error %d occured\n",err_code);
- return NULL;
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent.h b/openair2/LAYER2/PROTO_AGENT/proto_agent.h
deleted file mode 100644
index 4badda43b7..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 proto_agent.h
- * \brief top level protocol agent
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-#ifndef PROTO_AGENT_H_
-#define PROTO_AGENT_H_
-#include "ENB_APP/enb_config.h" // for enb properties
-#include "proto_agent_common.h"
-#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
-#include "RRC/NR/nr_rrc_defs.h"
-
-
-void *proto_agent_receive(void *args);
-
-int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p);
-void proto_agent_stop(mod_id_t mod_id);
-
-rlc_op_status_t proto_agent_send_rlc_data_req( const protocol_ctxt_t *const ctxt_pP,
- const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP,
- const rb_id_t rb_idP, const mui_t muiP, confirm_t confirmP,
- sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,const uint32_t *const SrcID, const uint32_t *const DstID);
-
-pdcp_data_ind_t proto_agent_send_pdcp_data_ind;
-
-#endif
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
deleted file mode 100644
index df3684ee27..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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
- */
-
-#include "proto_agent_async.h"
-#include "proto_agent_defs.h"
-
-
-#include "common/utils/LOG/log.h"
-
-proto_agent_async_channel_t *
-proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port,
- const char* peer_ip, uint16_t peer_port)
-{
- proto_agent_async_channel_t *channel;
- channel = malloc(sizeof(proto_agent_async_channel_t));
-
- if (channel == NULL)
- goto error;
-
- channel->enb_id = mod_id;
- channel->link = new_link_udp_server(bind_ip, bind_port);
-
- if (channel->link == NULL) goto error;
-
- channel->send_queue = new_message_queue();
- if (channel->send_queue == NULL) goto error;
- channel->receive_queue = new_message_queue();
- if (channel->receive_queue == NULL) goto error;
-
- channel->manager = create_link_manager(channel->send_queue,
- channel->receive_queue,
- channel->link);
- /* manually set remote IP&port for UDP server remote end */
- channel->manager->peer_port = peer_port;
- channel->manager->peer_addr = peer_ip;
-
- if (channel->manager == NULL) goto error;
-
- return channel;
-
- error:
- if (channel)
- free(channel);
- LOG_E(PROTO_AGENT, "error creating proto_agent_async_channel_t\n");
- return NULL;
-}
-
-int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info)
-{
- proto_agent_async_channel_t *channel = channel_info;
- return message_put(channel->send_queue, data, size, priority);
-}
-
-int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info)
-{
- proto_agent_async_channel_t *channel = channel_info;
- return message_get(channel->receive_queue, data, priority);
-}
-
-void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel) {
- message_get_unlock(channel->receive_queue);
-}
-
-void proto_agent_async_release(proto_agent_channel_t *channel)
-{
- proto_agent_async_channel_t *channel_info = channel->channel_info;
-
- destroy_link_manager(channel_info->manager);
-
- destroy_message_queue(channel_info->send_queue);
- destroy_message_queue(channel_info->receive_queue);
-
- close_link(channel_info->link);
- free(channel_info);
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h
deleted file mode 100644
index 6bc952e804..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_async.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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 enb_agent_async.h
- * \brief channel implementation for async interface
- * \author Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-#ifndef PROTO_AGENT_ASYNC_H_
-#define PROTO_AGENT_ASYNC_H_
-
-#include "proto_agent_net_comm.h"
-
-typedef struct proto_agent_async_channel_s {
- mod_id_t enb_id;
- socket_link_t *link;
- message_queue_t *send_queue;
- message_queue_t *receive_queue;
- link_manager_t *manager;
-} proto_agent_async_channel_t;
-
-proto_agent_async_channel_t *
-proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port,
- const char *peer_ip, uint16_t peer_port);
-
-int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
-
-int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info);
-
-/* unlocks a running proto_agent_async_msg_recv() */
-void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel);
-
-void proto_agent_async_release(proto_agent_channel_t *channel);
-
-
-#endif /*PROTO_AGENT_ASYNC_H_*/
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
deleted file mode 100644
index d3d00d1ada..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- * 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 proto_agent_common.c
- * \brief common primitives for all agents
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-#include
-#include
-#include
-
-#include "PHY/phy_extern.h"
-#include "proto_agent_common.h"
-#include "common/utils/LOG/log.h"
-#include "common/ran_context.h"
-
-extern RAN_CONTEXT_t RC;
-
-/*
- * message primitives
- */
-
-// Function to fill in the dl_data header (32bits) with the appropriate fields (doing bitwise operations)
-void fill_dl_data_header(int pdu_type, int spare, int seq_no, uint32_t *header) {
- uint32_t type = pdu_type;
- uint32_t spare_ = spare;
- uint32_t seq = seq_no;
- type = type << 28;
- spare_ = spare_ << 24;
- *header = (type | spare_);
- *header = (*header | seq);
- return;
-}
-
-
-// Function to retrieve data from the dl_data header (32bits) (doing bitwise operations)
-void read_dl_data_header(int *pdu_type, int *spare, int *seqno, uint32_t header) {
- *pdu_type = header;
- *spare = header;
- *seqno = header;
- *pdu_type = *pdu_type >> 28;
- *spare = *spare << 4;
- *spare = *spare >> 28;
- *seqno = *seqno << 8;
- *seqno = *seqno >> 8;
- return;
-}
-
-int f1u_serialize_message(Protocol__F1uMessage *msg, void **buf,int *size) {
- *size = protocol__f1u_message__get_packed_size(msg);
- *buf = malloc(*size);
-
- if (!(*buf))
- goto error;
-
- protocol__f1u_message__pack(msg, *buf);
- return 0;
-error:
- LOG_E(F1U, "an error occured\n");
- return -1;
-}
-
-int f1u_deserialize_message(void *data, int size, Protocol__F1uMessage **msg) {
- *msg = protocol__f1u_message__unpack(NULL, size, data);
-
- if (*msg == NULL)
- goto error;
-
- return 0;
-error:
- LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int f1u_dl_data_create_header(uint32_t pdu_type, uint32_t f1u_sn, Protocol__DlDataHeader **header) {
- *header = malloc(sizeof(Protocol__DlDataHeader));
-
- if(*header == NULL)
- goto error;
-
- protocol__dl_data_header__init(*header);
- LOG_D(F1U, "Initialized the DL Data User header\n");
- fill_dl_data_header(pdu_type, 0, f1u_sn, &(*header)->fields);
- return 0;
-error:
- LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int f1u_dl_data(const void *params, Protocol__F1uMessage **msg) {
- // Initialize the PDCP params
- dl_data_args *args = (dl_data_args *)params;
- Protocol__DlDataHeader *header;
-
- if (f1u_dl_data_create_header(args->pdu_type, args->sn, &header) != 0)
- goto error;
-
- Protocol__DlUserData *dl_data = NULL;
- *msg = malloc(sizeof(Protocol__DlUserData));
-
- if(*msg == NULL)
- goto error;
-
- // FIXME: Is the following used? It seems to be overwritten by the function
- // protocol__dl_user_data__init() anyway
- //dl_data = *msg;
- protocol__dl_user_data__init(dl_data);
- // Copy data to the bytes structure
- dl_data->pdu.data = malloc(args->sdu_size);
- dl_data->pdu.len = args->sdu_size;
- memcpy(dl_data->pdu.data, args->sdu_p, args->sdu_size);
- dl_data->frame = args->frame;
- dl_data->subframe = args->subframe;
- dl_data->rnti = args->rnti;
- dl_data->header = header;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(*msg != NULL)
- free(*msg);
-
- LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size) {
- *size = protocol__flexsplit_message__get_packed_size(msg);
- *buf = malloc(*size);
-
- if (!(*buf))
- goto error;
-
- protocol__flexsplit_message__pack(msg, *buf);
- return 0;
-error:
- LOG_E(MAC, "an error occured\n");
- return -1;
-}
-
-/* We assume that the buffer size is equal to the message size.
- Should be chekced durint Tx/Rx */
-int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg) {
- *msg = protocol__flexsplit_message__unpack(NULL, size, data);
-
- if (*msg == NULL)
- goto error;
-
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header) {
- *header = malloc(sizeof(Protocol__FspHeader));
-
- if(*header == NULL)
- goto error;
-
- protocol__fsp_header__init(*header);
- LOG_D(PROTO_AGENT, "Initialized the PROTOBUF message header\n");
- (*header)->version = FLEXSPLIT_VERSION;
- LOG_D(PROTO_AGENT, "Set the vversion to FLEXSPLIT_VERSION\n");
- (*header)->has_version = 1;
- (*header)->type = type;
- (*header)->has_type = 1;
- (*header)->xid = xid;
- (*header)->has_xid = 1;
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- return 1;
-}
-
-int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- Protocol__FspCtxt *ctxt = NULL;
- Protocol__FspRlcPdu *pdu = NULL;
- Protocol__FspRlcData *rlc_data = NULL;
- Protocol__FspRlcDataReq *data_req = NULL;
- // Initialize the PDCP params
- data_req_args *args = (data_req_args *)params;
- // Create the protobuf header
- Protocol__FspHeader *header;
- xid_t xid = mod_id;
- LOG_D(PROTO_AGENT, "creating the data_req message\n");
-
- if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_RLC_DATA_REQ, &header) != 0)
- goto error;
-
- /* Begin constructing the messages. They are defined as follows:
- * 1) fspRlcPdu is storing the bytes of the packet
- * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message)
- * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData
- */
- ctxt = malloc(sizeof(Protocol__FspCtxt));
- pdu = malloc(sizeof(Protocol__FspRlcPdu));
- rlc_data = malloc(sizeof(Protocol__FspRlcData));
- data_req = malloc(sizeof(Protocol__FspRlcDataReq));
- protocol__fsp_ctxt__init(ctxt);
- protocol__fsp_rlc_pdu__init(pdu);
- protocol__fsp_rlc_data__init(rlc_data);
- protocol__fsp_rlc_data_req__init(data_req);
- // Copy data to the RlcPdu structure
- pdu->fsp_pdu_data.data = malloc(args->sdu_size);
- pdu->fsp_pdu_data.len = args->sdu_size;
- memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size);
- pdu->has_fsp_pdu_data = 1;
- // Copy data to the ctxt structure
- ctxt->fsp_mod_id = args->ctxt->module_id;
- ctxt->fsp_enb_flag = args->ctxt->enb_flag;
- ctxt->fsp_instance = args->ctxt->instance;
- ctxt->fsp_rnti = args->ctxt->rnti;
- ctxt->fsp_frame = args->ctxt->frame;
- ctxt->fsp_subframe = args->ctxt->subframe;
- ctxt->fsp_enb_index = args->ctxt->eNB_index;
- ctxt->has_fsp_mod_id = 1;
- ctxt->has_fsp_enb_flag = 1;
- ctxt->has_fsp_instance = 1;
- ctxt->has_fsp_rnti = 1;
- ctxt->has_fsp_frame = 1;
- ctxt->has_fsp_subframe = 1;
- ctxt->has_fsp_enb_index = 1;
- rlc_data->fsp_ctxt = ctxt;
- rlc_data->fsp_srb_flag = args->srb_flag;
- rlc_data->fsp_mbms_flag = args->MBMS_flag;
- rlc_data->fsp_rb_id = args->rb_id;
- rlc_data->fsp_muip = args->mui;
- rlc_data->fsp_confirm = args->confirm;
- rlc_data->fsp_sdu_buffer_size = args->sdu_size;
- rlc_data->fsp_pdu = pdu;
- rlc_data->has_fsp_srb_flag = 1;
- rlc_data->has_fsp_mbms_flag = 1;
- rlc_data->has_fsp_rb_id = 1;
- rlc_data->has_fsp_muip = 1;
- rlc_data->has_fsp_confirm = 1;
- rlc_data->has_fsp_sdu_buffer_size = 1;
- // Up to here, everything is a signle message that is packed inside another. The final data_req
- // will be created later, after the setting of all variables
- data_req->header = header;
- data_req->enb_id = mod_id;
- data_req->has_enb_id = 1;
- data_req->pdcp_data = rlc_data;
- *msg = malloc(sizeof(Protocol__FlexsplitMessage));
-
- if(*msg == NULL)
- goto error;
-
- protocol__flexsplit_message__init(*msg);
- (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG;
- (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK
- (*msg)->has_msg_dir = 1;
- (*msg)->data_req_msg = data_req;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(pdu!=NULL)
- free(pdu);
-
- if(rlc_data!=NULL)
- free(rlc_data);
-
- if(data_req!= NULL)
- free(data_req);
-
- if(*msg != NULL)
- free(*msg);
-
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) {
- if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG)
- goto error;
-
- free(msg->data_req_msg->header);
- free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data);
- free(msg->data_req_msg->pdcp_data->fsp_pdu);
- free(msg->data_req_msg->pdcp_data->fsp_ctxt);
- free(msg->data_req_msg->pdcp_data);
- free(msg->data_req_msg);
- free(msg);
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
-/* code useless in this status: return 0 anyways
- rlc_op_status_t result = 0;
- printf("PROTO_AGENT: handling the data_req_ack message\n");
- Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
- Protocol__FspRlcDataReqAck *data_ack = input->data_req_ack;
- result = data_ack->result;
- printf("PROTO_AGENT: ACK RESULT IS %u\n", result);
- ack_result = result;
-*/
- return 0;
-}
-
-
-int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- rlc_op_status_t result = 0;
- Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
- Protocol__FspRlcDataReq *data_req = input->data_req_msg;
- Protocol__FspCtxt *ctxt = NULL;
- Protocol__FspRlcData *rlc_data = NULL;
- rlc_data = data_req->pdcp_data;
- ctxt = rlc_data->fsp_ctxt;
- protocol_ctxt_t ctxt_pP;
- srb_flag_t srb_flagP = 0;
- rb_id_t rb_idP = 0;
- mui_t muiP = 0;
- confirm_t confirmP = 0;
- MBMS_flag_t flag_MBMS = 0;
- sdu_size_t pdcp_pdu_size = 0;
- mem_block_t *pdcp_pdu_p = NULL;
- // Create a new protocol context for handling the packet
- ctxt_pP.module_id = ctxt->fsp_mod_id;
- ctxt_pP.enb_flag = ctxt->fsp_enb_flag;
- ctxt_pP.instance = ctxt->fsp_instance;
- ctxt_pP.rnti = ctxt->fsp_rnti;
- ctxt_pP.frame = ctxt->fsp_frame;
- ctxt_pP.subframe = ctxt->fsp_subframe;
- ctxt_pP.eNB_index = ctxt->fsp_enb_index;
- srb_flagP = rlc_data->fsp_srb_flag;
- flag_MBMS = rlc_data->fsp_mbms_flag;
- rb_idP = rlc_data->fsp_rb_id;
- muiP = rlc_data->fsp_muip;
- confirmP = rlc_data->fsp_confirm;
- pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len;
- pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__);
-
- if (!pdcp_pdu_p) {
- LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
- return -1;
- }
-
- memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size);
- if (RC.nrrrc) {
- LOG_D(PROTO_AGENT, "proto_agent received pdcp_data_req \n");
- // for (int i = 0; i < pdcp_pdu_size; i++)
- // printf(" %2.2x", (unsigned char)pdcp_pdu_p->data[i]);
- // printf("\n");
- du_rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
- result = 1;
- } else {
- result = rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p, NULL, NULL);
- }
- return result;
-}
-
-int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) {
- if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG)
- goto error;
-
- free(msg->data_ind_msg->header);
- free(msg->data_ind_msg->rlc_data->fsp_pdu->fsp_pdu_data.data);
- free(msg->data_ind_msg->rlc_data->fsp_pdu);
- free(msg->data_ind_msg->rlc_data->fsp_ctxt);
- free(msg->data_ind_msg->rlc_data);
- free(msg->data_ind_msg);
- free(msg);
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- Protocol__FspCtxt *ctxt = NULL;
- Protocol__FspRlcPdu *pdu = NULL;
- Protocol__FspRlcData *rlc_data = NULL;
- Protocol__FspPdcpDataInd *data_ind = NULL;
- // Initialize the PDCP params
- data_req_args *args = (data_req_args *)params;
- // Create the protobuf header
- Protocol__FspHeader *header;
- xid_t xid = mod_id;
- LOG_D(PROTO_AGENT, "creating the data_ind message\n");
-
- if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_PDCP_DATA_IND, &header) != 0)
- goto error;
-
- /* Begin constructing the messages. They are defined as follows:
- * 1) fspRlcPdu is storing the bytes of the packet
- * 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message)
- * 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData
- */
- ctxt = malloc(sizeof(Protocol__FspCtxt));
- pdu = malloc(sizeof(Protocol__FspRlcPdu));
- rlc_data = malloc(sizeof(Protocol__FspRlcData));
- data_ind = malloc(sizeof(Protocol__FspPdcpDataInd));
- protocol__fsp_ctxt__init(ctxt);
- protocol__fsp_rlc_pdu__init(pdu);
- protocol__fsp_rlc_data__init(rlc_data);
- protocol__fsp_pdcp_data_ind__init(data_ind);
- // Copy data to the RlcPdu structure
- pdu->fsp_pdu_data.data = malloc(args->sdu_size);
- pdu->fsp_pdu_data.len = args->sdu_size;
- memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size);
- pdu->has_fsp_pdu_data = 1;
- // Copy data to the ctxt structure
- ctxt->fsp_mod_id = args->ctxt->module_id;
- ctxt->fsp_enb_flag = args->ctxt->enb_flag;
- ctxt->fsp_instance = args->ctxt->instance;
- ctxt->fsp_rnti = args->ctxt->rnti;
- ctxt->fsp_frame = args->ctxt->frame;
- ctxt->fsp_subframe = args->ctxt->subframe;
- ctxt->fsp_enb_index = args->ctxt->eNB_index;
- ctxt->has_fsp_mod_id = 1;
- ctxt->has_fsp_enb_flag = 1;
- ctxt->has_fsp_instance = 1;
- ctxt->has_fsp_rnti = 1;
- ctxt->has_fsp_frame = 1;
- ctxt->has_fsp_subframe = 1;
- ctxt->has_fsp_enb_index = 1;
- rlc_data->fsp_ctxt = ctxt;
- rlc_data->fsp_srb_flag = args->srb_flag;
- rlc_data->fsp_mbms_flag = args->MBMS_flag;
- rlc_data->fsp_rb_id = args->rb_id;
- rlc_data->fsp_sdu_buffer_size = args->sdu_size;
- rlc_data->fsp_pdu = pdu;
- rlc_data->has_fsp_srb_flag = 1;
- rlc_data->has_fsp_mbms_flag = 1;
- rlc_data->has_fsp_rb_id = 1;
- rlc_data->has_fsp_sdu_buffer_size = 1;
- // Up to here, everything is a signle message that is packed inside another. The final data_req
- // will be created later, after the setting of all variables
- data_ind->header = header;
- data_ind->enb_id = mod_id;
- data_ind->has_enb_id = 1;
- data_ind->rlc_data = rlc_data;
- *msg = malloc(sizeof(Protocol__FlexsplitMessage));
-
- if(*msg == NULL)
- goto error;
-
- protocol__flexsplit_message__init(*msg);
- LOG_D(PROTO_AGENT,"setting the message case to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG);
- (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG;
- (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK
- (*msg)->has_msg_dir = 1;
- (*msg)->data_ind_msg = data_ind; //data_req;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(pdu!=NULL)
- free(pdu);
-
- if(rlc_data!=NULL)
- free(rlc_data);
-
- if(data_ind!= NULL)
- free(data_ind);
-
- if(*msg != NULL)
- free(*msg);
-
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- boolean_t result = 0;
- Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
- Protocol__FspPdcpDataInd *data_ind = input->data_ind_msg;
- Protocol__FspCtxt *ctxt = NULL;
- Protocol__FspRlcData *rlc_data = NULL;
- rlc_data = data_ind->rlc_data;
- ctxt = rlc_data->fsp_ctxt;
- protocol_ctxt_t ctxt_pP;
- srb_flag_t srb_flagP = 0;
- rb_id_t rb_idP = 0;
- sdu_size_t pdcp_pdu_size = 0;
- MBMS_flag_t flag_MBMS = 0;
- mem_block_t *pdcp_pdu_p = NULL;
- // Create a new protocol context for handling the packet
- ctxt_pP.module_id = ctxt->fsp_mod_id;
- ctxt_pP.enb_flag = ctxt->fsp_enb_flag;
- ctxt_pP.instance = ctxt->fsp_instance;
- ctxt_pP.rnti = ctxt->fsp_rnti;
- ctxt_pP.frame = ctxt->fsp_frame;
- ctxt_pP.subframe = ctxt->fsp_subframe;
- ctxt_pP.brOption = 0;
- ctxt_pP.eNB_index = ctxt->fsp_enb_index;
- srb_flagP = rlc_data->fsp_srb_flag;
- flag_MBMS = rlc_data->fsp_mbms_flag;
- rb_idP = rlc_data->fsp_rb_id;
- pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len;
- pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__);
-
- if (!pdcp_pdu_p) goto error;
-
- memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size);
- // if (xid == 1)
- // pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
- // else if (xid == 0) // FIXME: USE a preprocessed definition
- LOG_D(PROTO_AGENT, "[inst %ld] Received PDCP PDU with size %d for UE RNTI %x RB %ld, Calling pdcp_data_ind\n", ctxt_pP.instance, pdcp_pdu_size,ctxt_pP.rnti,rb_idP);
- result = pdcp_data_ind(&ctxt_pP,
- srb_flagP,
- flag_MBMS,
- rb_idP,
- pdcp_pdu_size,
- pdcp_pdu_p, NULL, NULL);
- return result;
-error:
-
- if (pdcp_pdu_p)
- free_mem_block(pdcp_pdu_p, __func__);
-
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- Protocol__FspHeader *header;
- Protocol__FspHello *hello_msg = NULL;
- /*TODO: Need to set random xid or xid from received hello message*/
- xid_t xid = mod_id;
-
- if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_HELLO, &header) != 0)
- goto error;
-
- LOG_D(PROTO_AGENT, "creating the HELLO message\n");
- hello_msg = malloc(sizeof(Protocol__FspHello));
-
- if(hello_msg == NULL)
- goto error;
-
- protocol__fsp_hello__init(hello_msg);
- hello_msg->header = header;
- *msg = malloc(sizeof(Protocol__FlexsplitMessage));
-
- if(*msg == NULL)
- goto error;
-
- protocol__flexsplit_message__init(*msg);
- (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG;
- (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME;
- (*msg)->has_msg_dir = 1;
- (*msg)->hello_msg = hello_msg;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(hello_msg!=NULL)
- free(hello_msg);
-
- if(*msg != NULL)
- free(*msg);
-
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-
-int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg) {
- if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG)
- goto error;
-
- free(msg->hello_msg->header);
- free(msg->hello_msg);
- free(msg);
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- Protocol__FspHeader *header;
- Protocol__FspEchoRequest *echo_request_msg = NULL;
- xid_t xid = mod_id;
-
- if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REQUEST, &header) != 0)
- goto error;
-
- LOG_D(PROTO_AGENT, "creating the echo request message\n");
- echo_request_msg = malloc(sizeof(Protocol__FspEchoRequest));
-
- if(echo_request_msg == NULL)
- goto error;
-
- protocol__fsp_echo_request__init(echo_request_msg);
- echo_request_msg->header = header;
- *msg = malloc(sizeof(Protocol__FlexsplitMessage));
-
- if(*msg == NULL)
- goto error;
-
- protocol__flexsplit_message__init(*msg);
- LOG_D(PROTO_AGENT,"setting the message direction to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG);
- (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG;
- (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE;
- (*msg)->has_msg_dir = 1;
- (*msg)->echo_request_msg = echo_request_msg;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(echo_request_msg != NULL)
- free(echo_request_msg);
-
- if(*msg != NULL)
- free(*msg);
-
- return -1;
-}
-
-int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg) {
- if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG)
- goto error;
-
- free(msg->echo_request_msg->header);
- free(msg->echo_request_msg);
- free(msg);
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
- xid_t xid;
- Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
- Protocol__FspEchoRequest *echo_req = input->echo_request_msg;
- Protocol__FspEchoReply *echo_reply_msg = NULL;
- xid = (echo_req->header)->xid;
- LOG_D(PROTO_AGENT, "creating the echo reply message\n");
- Protocol__FspHeader *header;
-
- if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REPLY, &header) != 0)
- goto error;
-
- echo_reply_msg = malloc(sizeof(Protocol__FspEchoReply));
-
- if(echo_reply_msg == NULL)
- goto error;
-
- protocol__fsp_echo_reply__init(echo_reply_msg);
- echo_reply_msg->header = header;
- *msg = malloc(sizeof(Protocol__FlexsplitMessage));
-
- if(*msg == NULL)
- goto error;
-
- protocol__flexsplit_message__init(*msg);
- (*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG;
- (*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME;
- (*msg)->has_msg_dir = 1;
- (*msg)->echo_reply_msg = echo_reply_msg;
- return 0;
-error:
-
- if(header != NULL)
- free(header);
-
- if(echo_reply_msg != NULL)
- free(echo_reply_msg);
-
- if(*msg != NULL)
- free(*msg);
-
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
-
-int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg) {
- if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG)
- goto error;
-
- free(msg->echo_reply_msg->header);
- free(msg->echo_reply_msg);
- free(msg);
- return 0;
-error:
- LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
- return -1;
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h
deleted file mode 100644
index 8f553e05e1..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_common.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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 enb_agent_common.h
- * \brief common message primitves and utilities
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-
-
-#ifndef PROTO_AGENT_COMMON_H_
-#define PROTO_AGENT_COMMON_H_
-
-#include
-
-#include "flexsplit.pb-c.h"
-
-// Do not need these
-//#include "stats_messages.pb-c.h"
-//#include "stats_common.pb-c.h"
-
-#include "proto_agent_defs.h"
-//#include "ENB_APP/enb_config.h"
-#include "UTIL/MEM/mem_block.h"
-
-//#include "LAYER2/MAC/extern.h"
-//#include "LAYER2/RLC/rlc.h"
-
-# include "tree.h"
-# include "intertask_interface.h"
-
-#define FLEXSPLIT_VERSION 0
-
-typedef int (*proto_agent_message_decoded_callback)(
- mod_id_t mod_id,
- const void *params,
- Protocol__FlexsplitMessage **msg
-);
-
-typedef int (*proto_agent_message_destruction_callback)(
- Protocol__FlexsplitMessage *msg
-);
-
-
-
-/**********************************
- * progRAN protocol messages helper
- * functions and generic handlers
- **********************************/
-
-int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size);
-int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg);
-
-uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size);
-
-err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg);
-
-int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header);
-
-int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg);
-int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg);
-int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg);
-
-int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg);
-int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg);
-int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-
-int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-
-
-int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
-
-
-Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id,
- uint8_t *data,
- int size);
-
-Protocol__FlexsplitMessage *proto_agent_handle_timed_task(void *args);
-
-typedef struct _data_req_args data_req_args;
-typedef struct _dl_data_args dl_data_args;
-
-struct _data_req_args{
- const protocol_ctxt_t* ctxt;
- srb_flag_t srb_flag;
- MBMS_flag_t MBMS_flag;
- rb_id_t rb_id;
- mui_t mui;
- confirm_t confirm;
- sdu_size_t sdu_size;
- mem_block_t *sdu_p;
-};
-
-struct _dl_data_args{
- uint8_t pdu_type;
- uint32_t sn;
- frame_t frame;
- sub_frame_t subframe;
- rnti_t rnti;
- sdu_size_t sdu_size;
- mem_block_t *sdu_p;
-};
-
-
-#endif
-
-
-
-
-
-
-
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h
deleted file mode 100644
index cd730a6de8..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_defs.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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 enb_agent_defs.h
- * \brief enb agent common definitions
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-#ifndef PROTO_AGENT_DEFS_H_
-#define PROTO_AGENT_DEFS_H_
-
-#include
-#include
-#include
-#include
-
-#include "openairinterface5g_limits.h"
-#include "UTIL/ASYNC_IF/link_manager.h"
-
-#define DEFAULT_PROTO_AGENT_IPv4_ADDRESS "127.0.0.1"
-#define DEFAULT_PROTO_AGENT_PORT 2210
-#define DEFAULT_PROTO_AGENT_CACHE "/mnt/oai_agent_cache"
-
-typedef enum {
-
- PROTO_AGENT_DEFAULT=0,
-
- ENB_AGENT_PHY=1,
- ENB_AGENT_MAC=2,
- ENB_AGENT_RLC=3,
- ENB_AGENT_PDCP=4,
- ENB_AGENT_RRC=5,
- ENB_AGENT_S1AP=6,
- ENB_AGENT_GTP=7,
- ENB_AGENT_X2AP=8,
-
- ENB_AGENT_MAX=9,
-
-} proto_agent_id_t;
-
-/*
-typedef enum {
- ENB_AGENT_ACTION_NONE = 0x0,
-
- ENB_AGENT_ACTION_SEND = 0x1,
-
- ENB_AGENT_ACTION_APPLY = 0x2,
-
- ENB_AGENT_ACTION_CLEAR = 0x4,
-
- ENB_AGENT_ACTION_WRITE = 0x8,
-
- ENB_AGENT_ACTION_FILTER = 0x10,
-
- ENB_AGENT_ACTION_PREPROCESS = 0x20,
-
- ENB_AGENT_ACTION_METER = 0x40,
-
- ENB_AGENT_ACTION_MAX = 0x7f,
-} agent_action_t;
-*/
-/*
-typedef enum {
-
- RAN_LTE_OAI= 0,
-
- RAN_NAME_MAX = 0x7f,
-} ran_name_t;
-*/
-typedef uint8_t xid_t;
-typedef uint8_t mod_id_t; // module or enb id
-typedef uint8_t lcid_t;
-typedef int32_t err_code_t;
-
-typedef struct {
- /* general info */
-
- /* stats */
-
- uint32_t total_rx_msg;
- uint32_t total_tx_msg;
-
- uint32_t rx_msg[NUMBER_OF_eNB_MAX];
- uint32_t tx_msg[NUMBER_OF_eNB_MAX];
-
-} proto_agent_info_t;
-
-/* forward declaration */
-struct proto_agent_channel_s;
-
-typedef struct proto_agent_instance_s {
- mod_id_t mod_id;
- proto_agent_info_t agent_info;
- struct proto_agent_channel_s *channel;
- pthread_t recv_thread;
- uint8_t exit;
-} proto_agent_instance_t;
-
-#endif
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
deleted file mode 100644
index 82f7849717..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_handler.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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 enb_agent_handler.c
- * \brief enb agent tx and rx message handler
- * \author Navid Nikaein and Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-
-#include "proto_agent_common.h"
-#include "common/utils/LOG/log.h"
-#include "assertions.h"
-
-proto_agent_message_decoded_callback proto_agent_messages_callback[][3] = {
- {proto_agent_hello, 0, 0}, /* agent hello */
- {proto_agent_echo_reply, 0, 0}, /* echo */
- {0, just_print, 0}, /* just print */
- {proto_agent_pdcp_data_req_process, proto_agent_pdcp_data_req_process, 0}, /* PDCP data REQ */
- {0, proto_agent_get_ack_result, 0}, /* get ACK result */
- {proto_agent_pdcp_data_ind_process, proto_agent_pdcp_data_ind_process, 0}, /* PDCP data IND */
- {0, just_print, 0}, /* just print */
-};
-
-proto_agent_message_destruction_callback proto_message_destruction_callback[] = {
- proto_agent_destroy_hello,
- proto_agent_destroy_echo_request,
- proto_agent_destroy_echo_reply,
- proto_agent_destroy_pdcp_data_req,
- 0,
- proto_agent_destroy_pdcp_data_ind,
- 0,
-};
-
-//static const char *proto_agent_direction2String[] = {
-// "", /* not_set */
-// "originating message", /* originating message */
-// "successfull outcome", /* successfull outcome */
-// "unsuccessfull outcome", /* unsuccessfull outcome */
-//};
-
-
-Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id,
- uint8_t *data,
- int size){
-
- Protocol__FlexsplitMessage *decoded_message = NULL;
- Protocol__FlexsplitMessage *reply_message = NULL;
- err_code_t err_code;
- DevAssert(data != NULL);
-
- LOG_D(PROTO_AGENT, "Deserializing message with size %u \n", size);
- if (proto_agent_deserialize_message(data, (int) size, &decoded_message) < 0) {
- err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_DECODING;
- goto error;
- }
- /* after deserialization, we don't need the original data memory anymore */
- free(data);
- Protocol__FspHeader *header = (Protocol__FspHeader*) decoded_message;
- if (header->has_type)
- {
- LOG_D(PROTO_AGENT, "Deserialized MSG type is %d and %u\n", decoded_message->msg_case, decoded_message->msg_dir);
- }
-
- if ((decoded_message->msg_case > sizeof(proto_agent_messages_callback) / (3*sizeof(proto_agent_message_decoded_callback))) ||
- (decoded_message->msg_dir > PROTOCOL__FLEXSPLIT_DIRECTION__UNSUCCESSFUL_OUTCOME))
- {
- err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_NOT_HANDLED;
- LOG_D(PROTO_AGENT,"Handling message: MSG NOT handled, going to error\n");
- goto error;
- }
-
-
- err_code = ((*proto_agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message));
-
- if ( err_code < 0 )
- {
- LOG_I(PROTO_AGENT, "decoded_message case : %d, direction : %d \n", decoded_message->msg_case-1, decoded_message->msg_dir-1);
- goto error;
- }
-
- protocol__flexsplit_message__free_unpacked(decoded_message, NULL);
- LOG_D(PROTO_AGENT,"Returning REPLY message after the callback\n");
- return reply_message;
-
- error:
- LOG_E(PROTO_AGENT,"errno %d occured\n",err_code);
- return NULL;
-}
-
-
-
-uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size)
-{
- uint8_t *buffer;
- err_code_t err_code = PROTOCOL__FLEXSPLIT_ERR__NO_ERR;
-
- if (proto_agent_serialize_message(msg, &buffer, size) < 0 ) {
- err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENCODING;
- goto error;
- }
-
- if (proto_message_destruction_callback[msg->msg_case-1])
- err_code = ((*proto_message_destruction_callback[msg->msg_case-1])(msg));
-
- DevAssert(buffer !=NULL);
-
- LOG_D(PROTO_AGENT,"Serialized the enb mac stats reply (size %d)\n", *size);
- return buffer;
-
- error :
- LOG_E(PROTO_AGENT,"errno %d occured\n",err_code);
-
- return NULL;
-}
-
-err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg) {
- return ((*proto_message_destruction_callback[msg->msg_case-1])(msg));
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
deleted file mode 100644
index 925c11c8f8..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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 enb_agent_net_comm.c
- * \brief enb agent network interface abstraction
- * \author Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-
-#include "proto_agent_net_comm.h"
-#include "common/utils/LOG/log.h"
-
-proto_agent_channel_t *proto_channel[NUMBER_OF_eNB_MAX][ENB_AGENT_MAX];
-static proto_agent_channel_instance_t channel_instance;
-int proto_agent_channel_id = 0;
-
-int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) {
- int i;
-
- if (channel == NULL) {
- return -1;
- }
-
- if (agent_id == ENB_AGENT_MAX) {
- for (i = 0; i < ENB_AGENT_MAX; i++) {
- proto_channel[mod_id][i] = channel;
- }
- } else {
- proto_channel[mod_id][agent_id] = channel;
- }
- return 0;
-}
-
-void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id) {
- int i;
-
- if (agent_id == ENB_AGENT_MAX) {
- for (i = 0; i < ENB_AGENT_MAX; i++) {
- proto_channel[mod_id][i] = NULL;
- }
- } else {
- proto_channel[mod_id][agent_id] = NULL;
- }
-}
-
-int proto_agent_create_channel(void *channel_info,
- int (*msg_send)(void *data, int size, int priority, void *channel_info),
- int (*msg_recv)(void **data, int *priority, void *channel_info),
- void (*release)(proto_agent_channel_t *channel)) {
-
- int channel_id = ++proto_agent_channel_id;
- proto_agent_channel_t *channel = (proto_agent_channel_t *) malloc(sizeof(proto_agent_channel_t));
- channel->channel_id = channel_id;
- channel->channel_info = channel_info;
- channel->msg_send = msg_send;
- channel->msg_recv = msg_recv;
- channel->release = release;
-
- /*element should be a real pointer*/
- RB_INSERT(proto_agent_channel_map, &channel_instance.proto_agent_head, channel);
-
- LOG_D(PROTO_AGENT, "Created a new channel with id 0x%x\n", channel->channel_id);
-
- return channel_id;
-}
-
-int proto_agent_destroy_channel(int channel_id) {
- int i, j;
-
- /*Check to see if channel exists*/
- struct proto_agent_channel_s *e = NULL;
- struct proto_agent_channel_s search;
- memset(&search, 0, sizeof(struct proto_agent_channel_s));
-
- e = RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search);
-
- if (e == NULL) {
- return -1;
- }
-
- /*Unregister the channel from all agents*/
- for (i = 0; i < NUMBER_OF_eNB_MAX; i++) {
- for (j = 0; j < ENB_AGENT_MAX; j++) {
- if (proto_channel[i][j] != NULL) {
- if (proto_channel[i][j]->channel_id == e->channel_id) {
- proto_channel[i][j] = NULL;
- }
- }
- }
- }
-
- /*Remove the channel from the tree and free memory*/
- RB_REMOVE(proto_agent_channel_map, &channel_instance.proto_agent_head, e);
- e->release(e);
- free(e);
-
- return 0;
-}
-
-err_code_t proto_agent_init_channel_container(void) {
- int i, j;
- LOG_D(PROTO_AGENT, "init RB tree for channel container\n");
-
- RB_INIT(&channel_instance.proto_agent_head);
-
- for (i = 0; i < NUMBER_OF_eNB_MAX; i++) {
- for (j = 0; j < ENB_AGENT_MAX; j++) {
- proto_channel[i][j] = NULL;
- }
- }
-
- return 0;
-}
-
-RB_GENERATE(proto_agent_channel_map,proto_agent_channel_s, entry, proto_agent_compare_channel);
-
-int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b) {
- if (a->channel_id < b->channel_id) return -1;
- if (a->channel_id > b->channel_id) return 1;
-
- // equal timers
- return 0;
-}
-
-proto_agent_channel_t * proto_agent_get_channel(int channel_id) {
-
- struct proto_agent_channel_s search;
- memset(&search, 0, sizeof(struct proto_agent_channel_s));
- search.channel_id = channel_id;
-
- return RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search);
-
-}
diff --git a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h b/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h
deleted file mode 100644
index 55fca5a928..0000000000
--- a/openair2/LAYER2/PROTO_AGENT/proto_agent_net_comm.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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 enb_agent_net_comm.h
- * \brief enb agent network interface abstraction
- * \autho Xenofon Foukas
- * \date 2016
- * \version 0.1
- */
-#ifndef PROTO_AGENT_NET_COMM_H_
-#define PROTO_AGENT_NET_COMM_H_
-
-#include "proto_agent_defs.h"
-
-#include "tree.h"
-#define ENB_AGENT_MAX 9
-
-/* forward declaration */
-struct proto_agent_async_channel_s;
-
-/*Channel related information used for Tx/Rx of protocol messages*/
-typedef struct proto_agent_channel_s {
- RB_ENTRY(proto_agent_channel_s) entry;
- int channel_id;
- struct proto_agent_async_channel_s *channel_info;
- /*Callbacks for channel message Tx and Rx*/
- int (*msg_send)(void *data, int size, int priority, void *channel_info);
- int (*msg_recv)(void **data, int *priority, void *channel_info);
- void (*release)(struct proto_agent_channel_s *channel);
-} proto_agent_channel_t;
-
-typedef struct proto_agent_channel_instance_s{
- RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head;
-} proto_agent_channel_instance_t;
-
-
-/*Register a channel to an agent. Use ENB_AGENT_MAX to register the
- *same channel to all agents*/
-int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id);
-
-/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/
-void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id);
-
-/*Create a new channel. Returns the id of the new channel or negative number otherwise*/
-int proto_agent_create_channel(void *channel_info,
- int (*msg_send)(void *data, int size, int priority, void *channel_info),
- int (*msg_recv)(void **data, int *priority, void *channel_info),
- void (*release)(proto_agent_channel_t *channel));
-
-/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/
-int proto_agent_destroy_channel(int channel_id);
-
-/*Return an agent communication channel based on its id*/
-proto_agent_channel_t * proto_agent_get_channel(int channel_id);
-
-/*Should be called before performing any channel operations*/
-err_code_t proto_agent_init_channel_container(void);
-
-int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b);
-
-/* RB_PROTOTYPE is for .h files */
-RB_PROTOTYPE(proto_agent_channel_map, proto_agent_channel_s, entry, proto_agent_compare_channel);
-
-#endif /*ENB_AGENT_COMM_H_*/
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
index de947225bb..4eb0907046 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
@@ -27,7 +27,6 @@
//-----------------------------------------------------------------------------
#include "assertions.h"
-#include "msc.h"
#include "hashtable.h"
#include "rlc_am.h"
#include "rlc_am_segment.h"
@@ -238,17 +237,6 @@ void config_req_rlc_am_asn1 (
(config_am_pP->ul_AM_RLC.t_PollRetransmitdl_AM_RLC.t_Reordering<32) &&
(config_am_pP->dl_AM_RLC.t_StatusProhibitenb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_PollRetx %u t_Reord %u t_StatusPro %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
- am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
- t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
@@ -267,14 +255,6 @@ void config_req_rlc_am_asn1 (
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
} else {
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
LOG_D(RLC,
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
@@ -537,27 +517,6 @@ rlc_am_mac_status_indication (
}
}
- if (MESSAGE_CHART_GENERATOR) {
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
- NULL,0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc));
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
- NULL,0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-RESP BO:%u/n%u(%u) %s sdu remain %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc),
- status_resp.buffer_occupancy_in_bytes,
- status_resp.buffer_occupancy_in_pdus,rlc->nb_sdu,
- (status_resp.head_sdu_is_segmented)?"sdu seg":"sdu not seg",
- status_resp.head_sdu_remaining_size_to_send);
- }
-
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) -> %d bytes\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc),
@@ -610,7 +569,7 @@ rlc_am_mac_data_request (
data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state;
- if ( (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) {
+ if ( (LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) {
tb_p = data_req.data.head;
while (tb_p != NULL) {
@@ -619,39 +578,6 @@ rlc_am_mac_data_request (
if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
- if (MESSAGE_CHART_GENERATOR) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- pdu_info.sn,
- tb_size_in_bytes,
- pdu_info.rf,
- pdu_info.p,
- pdu_info.fi);
-
- if (pdu_info.rf) {
- message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf);
- message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so);
- }
-
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "| HE:");
-
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
- }
- }
-
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (char *)rlc_am_pdu_sn_10_p,
- tb_size_in_bytes,
- message_string);
- }
-
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size = 0;
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
@@ -723,34 +649,6 @@ rlc_am_mac_data_request (
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos!
- if (MESSAGE_CHART_GENERATOR ) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS ACK_SN %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- l_rlc_p->control_pdu_info.ack_sn);
-
- for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
- if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
- message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
- l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
- l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
- l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
- } else {
- message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
- l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
- }
- }
-
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (char *)rlc_am_pdu_sn_10_p,
- tb_size_in_bytes,
- message_string);
- }
-
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size = 0;
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
@@ -780,7 +678,7 @@ rlc_am_mac_data_request (
tb_p = tb_p->next;
} /* while */
- } /* MESSAGE_CHART_GENERATOR && data_req.data.nb_elements > 0 */
+ } /* data_req.data.nb_elements > 0 */
data_req.buffer_occupancy_in_pdus = 0;
return data_req;
@@ -812,7 +710,7 @@ rlc_am_mac_data_indication (
(void)index;
(void)l_rlc_p; /* avoid gcc warning "unused variable" */
- if ( LOG_DEBUGFLAG(DEBUG_RLC) || MESSAGE_CHART_GENERATOR ) {
+ if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
if (data_indP.data.nb_elements > 0) {
tb_p = data_indP.data.head;
@@ -822,39 +720,6 @@ rlc_am_mac_data_indication (
if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
- if (MESSAGE_CHART_GENERATOR) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- pdu_info.sn,
- tb_size_in_bytes,
- pdu_info.rf,
- pdu_info.p,
- pdu_info.fi);
-
- if (pdu_info.rf) {
- message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf);
- message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so);
- }
-
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "| HE:");
-
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
- }
- }
-
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (char *)rlc_am_pdu_sn_10_p,
- tb_size_in_bytes,
- message_string);
- }
-
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
@@ -923,34 +788,6 @@ rlc_am_mac_data_indication (
}
} else {
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
- if (MESSAGE_CHART_GENERATOR) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS size ACK_SN %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- l_rlc_p->control_pdu_info.ack_sn);
-
- for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
- if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
- message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
- l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
- l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
- l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
- } else {
- message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
- l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
- }
- }
-
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (char *)rlc_am_pdu_sn_10_p,
- tb_size_in_bytes,
- message_string);
- }
-
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size = 0;
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
@@ -1009,16 +846,6 @@ rlc_am_data_req (
mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui;
data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset;
data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size;
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (const char *)(&sdu_pP->data[data_offset]),
- data_size,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- data_size,
- mui);
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
@@ -1094,22 +921,6 @@ rlc_am_data_req (
l_rlc_p->vt_s);
}
} else {
- if( MESSAGE_CHART_GENERATOR) {
- mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui;
- data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset;
- data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size;
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (const char *)(&sdu_pP->data[data_offset]),
- data_size,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
- data_size,
- mui);
- }
-
LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d vtA=%d vtS=%d\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
l_rlc_p->nb_sdu,
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
index 3127f67eca..b4073303dd 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
@@ -78,16 +78,7 @@
int pmtl_rc = pthread_mutex_trylock(mUTEX);\
if (pmtl_rc != 0){\
if (pmtl_rc == EBUSY) {\
- MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 " PROTOCOL_RLC_AM_MSC_FMT " Warning try lock %s busy",\
- PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
- #mUTEX);\
pthread_mutex_lock(mUTEX);\
- } else {\
- MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 " PROTOCOL_RLC_AM_MSC_FMT " Error try lock %s %d",\
- PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
- #mUTEX, pmtl_rc);\
}\
}\
} while (0);
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
index 793d0057ac..0957c20bdf 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
@@ -30,7 +30,6 @@
#include "list.h"
//#include "LAYER2/MAC/extern.h"
#include "common/utils/LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
inline void
@@ -152,16 +151,6 @@ rlc_am_send_sdu (
#if !ENABLE_ITTI
RLC_AM_MUTEX_UNLOCK(&rlc_pP->lock_input_sdus);
#endif
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (const char *)(rlc_pP->output_sdu_in_construction->data),
- rlc_pP->output_sdu_size_to_write,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-IND size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP),
- rlc_pP->output_sdu_size_to_write
- );
rlc_data_ind (ctxt_pP,
BOOL_NOT(rlc_pP->is_data_plane),
MBMS_FLAG_NO,
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
index f9a4affb6b..916d1513b0 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
@@ -24,7 +24,6 @@
#include "platform_types.h"
//-----------------------------------------------------------------------------
#include "assertions.h"
-#include "msc.h"
#include "rlc.h"
#include "rlc_am.h"
#include "list.h"
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
index 4d34338ea9..56b37e1e39 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
@@ -28,7 +28,6 @@
#include "rlc.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
boolean_t rlc_am_nack_pdu (
const protocol_ctxt_t* const ctxt_pP,
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
index dbe55c483d..ed81e119ac 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
@@ -26,7 +26,6 @@
//-----------------------------------------------------------------------------
#include "platform_types.h"
//-----------------------------------------------------------------------------
-#include "msc.h"
#include "list.h"
#include "rlc_am.h"
#include "LAYER2/MAC/mac_extern.h"
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
index e421a36619..969ed2d7a5 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
@@ -29,7 +29,6 @@
#include "rlc_am.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_poll_retransmit(
@@ -69,11 +68,6 @@ rlc_am_check_timer_poll_retransmit(
rlc_pP->t_poll_retransmit.running = 0;
rlc_pP->t_poll_retransmit.timed_out = 1;
rlc_pP->stat_timer_poll_retransmit_timed_out += 1;
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit timed-out",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
@@ -144,11 +138,6 @@ rlc_am_stop_and_reset_timer_poll_retransmit(
rlc_pP->t_poll_retransmit.ms_time_out = 0;
rlc_pP->t_poll_retransmit.ms_start = 0;
rlc_pP->t_poll_retransmit.timed_out = 0;
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit stopped & reseted",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
}
//-----------------------------------------------------------------------------
void
@@ -167,11 +156,6 @@ rlc_am_start_timer_poll_retransmit(
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_poll_retransmit.ms_time_out);
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit started (TO %u ms)",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out);
-#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
index 262b8a8391..d161d29a65 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
@@ -28,7 +28,6 @@
#include "rlc_am.h"
# include "LAYER2/MAC/mac_extern.h"
#include "common/utils//LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_reordering(
@@ -64,12 +63,6 @@ rlc_am_check_timer_reordering(
// - start t-Reordering;
// - set VR(X) to VR(H).
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering timed out",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
-
//AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
if(rlc_pP->vr_x == RLC_SN_UNDEFINED){
LOG_E(RLC, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
@@ -153,11 +146,6 @@ rlc_am_stop_and_reset_timer_reordering(
rlc_pP->t_reordering.ms_time_out = 0;
rlc_pP->t_reordering.ms_start = 0;
rlc_pP->t_reordering.timed_out = 0;
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering stopped & reseted",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
}
//-----------------------------------------------------------------------------
void
@@ -175,11 +163,6 @@ rlc_am_start_timer_reordering(
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = %5u ms)\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_reordering.ms_time_out);
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering started (TO %u ms)",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out);
-#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
index 5b0b0a70fa..aae7465bcf 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
@@ -28,7 +28,6 @@
#include "rlc_am.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
void
rlc_am_check_timer_status_prohibit(
@@ -60,12 +59,6 @@ rlc_am_check_timer_status_prohibit(
rlc_pP->t_status_prohibit.running = 0;
rlc_pP->t_status_prohibit.timed_out = 1;
rlc_pP->stat_timer_status_prohibit_timed_out += 1;
-
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit timed out",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] TIME-OUT\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
//#warning TO DO rlc_am_check_timer_status_prohibit
@@ -91,11 +84,6 @@ rlc_am_stop_and_reset_timer_status_prohibit(
rlc_pP->t_status_prohibit.ms_time_out = 0;
rlc_pP->t_status_prohibit.ms_start = 0;
rlc_pP->t_status_prohibit.timed_out = 0;
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit stopped & reseted",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
-#endif
}
}
//-----------------------------------------------------------------------------
@@ -117,11 +105,6 @@ rlc_am_start_timer_status_prohibit(
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->t_status_prohibit.ms_time_out);
LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out);
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit started (TO %u ms)",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out);
-#endif
} else {
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
index 654ddb8da7..1d40b12cc8 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
@@ -30,7 +30,6 @@
#include "intertask_interface.h"
#endif
#include "assertions.h"
-#include "msc.h"
#include "rlc_um.h"
#include "list.h"
#include "rlc_primitives.h"
@@ -166,7 +165,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
char message_string[10000];
mem_block_t *tb_p;
int16_t tb_size_in_bytes;
- size_t message_string_size = 0;
rlc_um_pdu_info_t pdu_info;
int index;
int octet_index;
@@ -183,38 +181,15 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
LOG_I(RLC, PROTOCOL_RLC_UM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p));
- if (data_indP.data.nb_elements > 0 && MESSAGE_CHART_GENERATOR) {
+ if (data_indP.data.nb_elements > 0) {
tb_p = data_indP.data.head;
while (tb_p != NULL) {
tb_size_in_bytes = ((struct mac_tb_ind *) (tb_p->data))->size;
rlc_um_get_pdu_infos(ctxt_pP,l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_ind *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
- pdu_info.sn,
- tb_size_in_bytes,
- pdu_info.fi);
-
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "| HE:");
-
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
- }
- }
-
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (const char *)pdu_info.payload,
- tb_size_in_bytes,
- message_string);
tb_p = tb_p->next;
}
- }/*MESSAGE_CHART_GENERATOR*/
+ }
list_free (&data_indP.data);
break;
@@ -237,7 +212,7 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
// - enters the LOCAL_SUSPEND state.
data_indP.tb_size = data_indP.tb_size >> 3;
- if (data_indP.data.nb_elements > 0 && (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))) {
+ if (data_indP.data.nb_elements > 0 && (LOG_DEBUGFLAG(DEBUG_RLC))) {
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" MAC_DATA_IND %d TBs\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p),
data_indP.data.nb_elements);
@@ -251,32 +226,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
&pdu_info,
l_rlc_p->rx_sn_length);
- if (MESSAGE_CHART_GENERATOR) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
- pdu_info.sn,
- tb_size_in_bytes,
- pdu_info.fi);
-
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "| HE:");
-
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
- }
- }
-
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (char *)pdu_info.payload,
- tb_size_in_bytes,
- message_string);
- }
-
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
message_string_size = 0;
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
@@ -483,89 +432,61 @@ rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,cons
continue;
}
- if (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) ) {
+ if (LOG_DEBUGFLAG(DEBUG_RLC) ) {
rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_req *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
- if(MESSAGE_CHART_GENERATOR) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size],
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA SN %u size %u FI %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
- pdu_info.sn,
- tb_size_in_bytes,
- pdu_info.fi);
+ message_string_size = 0;
+ message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
+ message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
+ message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
+ message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
+ message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
+ message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
+ message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
+ message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
+ message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "|HE:");
+ if (pdu_info.e) {
+ message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
- }
+ for (index=0; index < pdu_info.num_li; index++) {
+ message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
}
-
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
- (const char *)pdu_info.payload,
- pdu_info.payload_size,
- message_string);
}
- if(LOG_DEBUGFLAG(DEBUG_RLC)) {
- message_string_size = 0;
- message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
- message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
- message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
- message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
- message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
- message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
- message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
- message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
- message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
+ message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
+ message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
+ message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
+ message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
- if (pdu_info.e) {
- message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
-
- for (index=0; index < pdu_info.num_li; index++) {
- message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
- }
- }
-
- message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
- message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
- message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
- message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
-
- for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
- if ((octet_index % 16) == 0) {
- if (octet_index != 0) {
- message_string_size += sprintf(&message_string[message_string_size], " |\n");
- }
-
- message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
+ for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
+ if ((octet_index % 16) == 0) {
+ if (octet_index != 0) {
+ message_string_size += sprintf(&message_string[message_string_size], " |\n");
}
- /*
- * Print every single octet in hexadecimal form
- */
- message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
- /*
- * Align newline and pipes according to the octets in groups of 2
- */
+ message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
}
/*
- * Append enough spaces and put final pipe
+ * Print every single octet in hexadecimal form
*/
- for (index = octet_index; index < 16; ++index) {
- message_string_size += sprintf(&message_string[message_string_size], " ");
- }
+ message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
+ /*
+ * Align newline and pipes according to the octets in groups of 2
+ */
+ }
- message_string_size += sprintf(&message_string[message_string_size], " |\n");
- LOG_UI(RLC, "%s\n", message_string);
- } /*LOG_DEBUGFLAG(DEBUG_RLC) */
- } /* MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) */
+ /*
+ * Append enough spaces and put final pipe
+ */
+ for (index = octet_index; index < 16; ++index) {
+ message_string_size += sprintf(&message_string[message_string_size], " ");
+ }
+
+ message_string_size += sprintf(&message_string[message_string_size], " |\n");
+ LOG_UI(RLC, "%s\n", message_string);
+ } /* LOG_DEBUGFLAG(DEBUG_RLC) */
tb_p = tb_p->next;
} /* while (tb_p != NULL) */
@@ -607,15 +528,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t
//rlc_p->next_sdu_index = (rlc_p->next_sdu_index + 1) % rlc_p->size_input_sdus_buffer;
rlc_p->stat_tx_pdcp_sdu += 1;
rlc_p->stat_tx_pdcp_bytes += ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size;
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-REQ size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, rlc_p),
- ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size);
if (LOG_DEBUGFLAG(DEBUG_RLC) ) {
data_offset = sizeof (struct rlc_um_data_req_alloc);
@@ -660,14 +572,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t
list_add_tail_eurecom(sdu_pP, &rlc_p->input_sdus);
RLC_UM_MUTEX_UNLOCK(&rlc_p->lock_input_sdus);
- if (MESSAGE_CHART_GENERATOR) {
- if (rlc_p->buffer_occupancy > 4096) {
- MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 "PROTOCOL_RLC_AM_MSC_FMT" BO %u bytes",\
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy);
- }
- }
-
LOG_T(RLC, PROTOCOL_RLC_UM_CTXT_FMT" BO %d , NB SDU %d\n",
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
rlc_p->buffer_occupancy,
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
index be06551dde..bd04ff3ece 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
@@ -56,28 +56,13 @@
rLC_Pp->rb_id,\
__FUNCTION__
-#define PROTOCOL_RLC_UM_MSC_FMT "[RNTI %" PRIx16 " %s %02ld]"
-#define PROTOCOL_RLC_UM_MSC_ARGS(CTXT_Pp, rLC_Pp) \
- CTXT_Pp->rnti,\
- (rLC_Pp->is_data_plane) ? "DRB UM" : "SRB UM",\
- rLC_Pp->rb_id
-
#if defined(TRACE_RLC_MUTEX)
#define RLC_UM_MUTEX_LOCK(mUTEX, cTXT, rLC) \
do {\
int pmtl_rc = pthread_mutex_trylock(mUTEX);\
if (pmtl_rc != 0){\
if (pmtl_rc == EBUSY) {\
- MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 " PROTOCOL_RLC_UM_MSC_FMT " Warning try lock %s busy",\
- PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
- #mUTEX);\
pthread_mutex_lock(mUTEX);\
- } else {\
- MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
- "0 " PROTOCOL_RLC_UM_MSC_FMT " Error try lock %s %d",\
- PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
- #mUTEX, pmtl_rc);\
}\
}\
} while (0);
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
index 05c3423f76..bec815ac5d 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.c
@@ -32,7 +32,6 @@
#include "rlc_um_control_primitives.h"
#include "LTE_T-Reordering.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
void config_req_rlc_um (
@@ -173,15 +172,6 @@ void config_req_rlc_um_asn1 (
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
rlc_p->rb_id,
ul_rlc_pP->sn_FieldLength);
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ UL sn_FieldLength %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
- ul_rlc_pP->sn_FieldLength);
return;
}
}
@@ -201,15 +191,6 @@ void config_req_rlc_um_asn1 (
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
rlc_p->rb_id,
dl_rlc_pP->sn_FieldLength);
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ DL sn_FieldLength %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
- dl_rlc_pP->sn_FieldLength);
return;
}
@@ -220,15 +201,6 @@ void config_req_rlc_um_asn1 (
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
rlc_p->rb_id,
dl_rlc_pP->t_Reordering);
- MSC_LOG_RX_DISCARDED_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
- dl_rlc_pP->t_Reordering);
return;
}
}
@@ -239,34 +211,12 @@ void config_req_rlc_um_asn1 (
ul_sn_FieldLength,
dl_sn_FieldLength,
mbms_flagP);
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
- t_Reordering,
- ul_sn_FieldLength,
- dl_sn_FieldLength);
} else {
rlc_um_configure(ctxt_pP,rlc_p,
t_Reordering,
dl_sn_FieldLength,
ul_sn_FieldLength,
mbms_flagP);
- MSC_LOG_RX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
- NULL,
- 0,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
- t_Reordering,
- dl_sn_FieldLength,
- ul_sn_FieldLength);
}
}
}
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 c8faa08358..6d2380d4ff 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
@@ -24,7 +24,6 @@
#include "platform_types.h"
#include "assertions.h"
//-----------------------------------------------------------------------------
-#include "msc.h"
#include "rlc.h"
#include "rlc_um.h"
#include "rlc_primitives.h"
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c
index 2eba223803..ca43dab667 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.c
@@ -35,7 +35,6 @@
#include "list.h"
#include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h"
-#include "msc.h"
//-----------------------------------------------------------------------------
inline void
@@ -117,17 +116,6 @@ rlc_um_send_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
rlc_pP->stat_rx_pdcp_sdu += 1;
rlc_pP->stat_rx_pdcp_bytes += rlc_pP->output_sdu_size_to_write;
- MSC_LOG_TX_MESSAGE(
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
- (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
- (const char*)(rlc_pP->output_sdu_in_construction->data),
- rlc_pP->output_sdu_size_to_write,
- MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-IND size %u",
- MSC_AS_TIME_ARGS(ctxt_pP),
- PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP,rlc_pP),
- rlc_pP->output_sdu_size_to_write
- );
-
#if TEST_RLC_UM
#if TRACE_RLC_UM_DISPLAY_ASCII_DATA
rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write] = 0;
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
index 932bb1376e..4c047e3d92 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
@@ -27,7 +27,6 @@
//-----------------------------------------------------------------------------
#include
#include "assertions.h"
-#include "msc.h"
#include "list.h"
#include "rlc_um.h"
#include "rlc_primitives.h"
diff --git a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h b/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h
deleted file mode 100644
index 75ccc9fcdd..0000000000
--- a/openair2/LAYER2/RLC/rlc_proto_agent_primitives.h
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#ifndef __PROTO_AGENT_RLC_PRIMITIVES_H__
-#define __PROTO_AGENT_RLC_PRIMITIVES_H__
-
-#include "RRC/LTE/rrc_defs.h"
-#include "LAYER2/PROTO_AGENT/proto_agent.h"
-// PROTO AGENT
-pthread_t async_server_thread;
-int async_server_thread_finalize (void);
-void async_server_thread_init (void);
-
-pthread_mutex_t async_server_lock;
-pthread_cond_t async_server_notify;
-int async_server_shutdown;
-
-#endif
diff --git a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
index ab8578a0e7..1f66400af1 100644
--- a/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+++ b/openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
@@ -101,13 +101,6 @@ typedef struct {
static rlc_data_req_queue q;
-extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
- const NR_SRB_ToAddModList_t * const srb2add_listP,
- const NR_DRB_ToAddModList_t * const drb2add_listP,
- const NR_DRB_ToReleaseList_t * const drb2release_listP,
- const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
- struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
-
static void *rlc_data_req_thread(void *_)
{
int i;
@@ -674,7 +667,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header
}
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset);
- itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
+ itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
}
}
}
@@ -728,7 +721,7 @@ rb_found:
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
__func__, rb_id, size);
extern instance_t CUuniqInstance;
- itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p);
+ itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
} else {
memblock = get_free_mem_block(size, __FUNCTION__);
@@ -1103,7 +1096,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
if (kRRCint != NULL) {
/* todo */
}
-
+
if (drb2release_list != NULL) {
// TODO
}
diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c
index d7923e5490..af8cb5715a 100644
--- a/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c
+++ b/openair2/LAYER2/nr_rlc/nr_rlc_entity_am.c
@@ -1044,7 +1044,7 @@ next_pdu:
set_end_different_sdu:
/* don't go more than rx_highest_status - 1 */
if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) {
- ret.so_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
+ ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
entity->sn_modulus;
ret.so_end = 0xffff;
return ret;
@@ -1305,9 +1305,8 @@ static int missing_size(nr_rlc_entity_am_t *entity, missing_data_t *m,
missing_data_t m_nack;
/* be careful to limit a range to 255 SNs, that is: cut if needed */
- sn_count = m->sn_end - m->sn_start + 1;
- if (sn_count < 0)
- sn_count += entity->sn_modulus;
+ sn_count = (m->sn_end - m->sn_start + entity->sn_modulus)
+ % entity->sn_modulus + 1;
sn_start = m->sn_start;
diff --git a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
index 78e06d37e2..baae1fa436 100644
--- a/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+++ b/openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
@@ -40,8 +40,6 @@
#include "openair2/F1AP/f1ap_du_rrc_message_transfer.h"
-#include "openair2/LAYER2/PROTO_AGENT/proto_agent.h"
-
extern RAN_CONTEXT_t RC;
#include
@@ -518,7 +516,7 @@ rb_found:
req->pdusession_id=rb_id;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
extern instance_t DUuniqInstance;
- itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
+ itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
return;
}
}
diff --git a/openair2/LAYER2/rlc_v2/rlc_oai_api.c b/openair2/LAYER2/rlc_v2/rlc_oai_api.c
index 16c3db0cae..2a6f00c13c 100644
--- a/openair2/LAYER2/rlc_v2/rlc_oai_api.c
+++ b/openair2/LAYER2/rlc_v2/rlc_oai_api.c
@@ -440,7 +440,7 @@ rb_found:
req->rnti=ue->rnti;
req->rab_id=rb_id+4;
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
- itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
+ itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
return;
}
}
diff --git a/openair2/M2AP/m2ap_MCE_generate_messages.c b/openair2/M2AP/m2ap_MCE_generate_messages.c
index a28097cf1a..969863b445 100644
--- a/openair2/M2AP/m2ap_MCE_generate_messages.c
+++ b/openair2/M2AP/m2ap_MCE_generate_messages.c
@@ -39,7 +39,6 @@
#include "m2ap_itti_messaging.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
@@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request(
return -1;
}
- //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
-
m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0);
return ret;
@@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC
m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY;
- //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id);
-
m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0);
return ret;
@@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance,
return -1;
}
- //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE,
- // MSC_M2AP_TARGET_MCE, NULL, 0,
- // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
- // assoc_id, cause_type, cause_value);
-
m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
return ret;
@@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
-//
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id);
-//
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
-//
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
-//
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
//
// return ret;
diff --git a/openair2/M2AP/m2ap_MCE_handler.c b/openair2/M2AP/m2ap_MCE_handler.c
index 5a0e303218..3f6d5ff64d 100644
--- a/openair2/M2AP/m2ap_MCE_handler.c
+++ b/openair2/M2AP/m2ap_MCE_handler.c
@@ -44,7 +44,6 @@
#include "m2ap_MCE_interface_management.h"
//#include "m2ap_eNB_interface_management.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
diff --git a/openair2/M2AP/m2ap_MCE_interface_management.c b/openair2/M2AP/m2ap_MCE_interface_management.c
index 3b12f41cbe..28f5fccffa 100644
--- a/openair2/M2AP/m2ap_MCE_interface_management.c
+++ b/openair2/M2AP/m2ap_MCE_interface_management.c
@@ -210,16 +210,7 @@ int MCE_handle_MBMS_SESSION_START_RESPONSE(instance_t instance,
AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
//M2AP_SESSION_START_RESP(msg_p).
-// MSC_LOG_RX_MESSAGE(
-// MSC_M2AP_MCE,
-// MSC_M2AP_ENB,
- //return 0;
-// 0,
-// 0,
-// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d",
-// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
-// assoc_id);
-//
+
LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g);
@@ -348,14 +339,6 @@ int MCE_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance,
AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
// M2AP_SESSION_STOP_RESP(msg_p).
- // MSC_LOG_RX_MESSAGE(
- // MSC_M2AP_MCE,
- // MSC_M2AP_ENB,
- // 0,
- // 0,
- // MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // assoc_id);
// LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
@@ -645,14 +628,6 @@ int MCE_handle_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance,
// }
//
// M2AP_SESSION_STOP_RESP(msg_p).
-// MSC_LOG_RX_MESSAGE(
-// MSC_M2AP_MCE,
-// MSC_M2AP_ENB,
-// 0,
-// 0,
-// MSC_AS_TIME_FMT" MCE_handle_M2_SCHEDULING_INFORMATION_RESPONSE successfulOutcome assoc_id %d",
-// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
-// assoc_id);
//
// LOG_D(M2AP, "Sending M2AP_SCHEDULING_INFO_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
@@ -836,15 +811,6 @@ int MCE_handle_M2_SETUP_REQUEST(instance_t instance,
*m2ap_mce_data_from_enb = M2AP_SETUP_REQ(message_p);
//printf("m2ap_mce_data_from_enb->assoc_id %d %d\n",m2ap_mce_data_from_enb->assoc_id,assoc_id);
-// MSC_LOG_TX_MESSAGE(
-// MSC_M2AP_MCE,
-// MSC_RRC_ENB,
-// 0,
-// 0,
-// MSC_AS_TIME_FMT" MCE_handle_M2_SETUP_REQUEST",
-// 0,0//MSC_AS_TIME_ARGS(ctxt_pP),
-// );
-//
if (num_mbms_available > 0) {
itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else {
@@ -1217,15 +1183,6 @@ int MCE_handle_MCE_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
//for (int i=0;i 0, "System Information %d is missing",i);
- //MSC_LOG_RX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_CU,
- // 0,
- // 0,
- // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // assoc_id);
-
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
@@ -1430,16 +1387,7 @@ int MCE_handle_MBMS_SERVICE_COUNTING_RESPONSE(instance_t instance,
//AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
//AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
//M2AP_SESSION_START_RESP(msg_p).
-// MSC_LOG_RX_MESSAGE(
-// MSC_M2AP_MCE,
-// MSC_M2AP_ENB,
- //return 0;
-// 0,
-// 0,
-// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d",
-// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
-// assoc_id);
-//
+
//LOG_D(M2AP, "Sending ITTI message to ENB_APP with assoc_id (%d->%d)\n",
//assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
diff --git a/openair2/M2AP/m2ap_eNB_generate_messages.c b/openair2/M2AP/m2ap_eNB_generate_messages.c
index b6c821e1ce..6496d608b8 100644
--- a/openair2/M2AP/m2ap_eNB_generate_messages.c
+++ b/openair2/M2AP/m2ap_eNB_generate_messages.c
@@ -39,7 +39,6 @@
#include "m2ap_itti_messaging.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
@@ -169,15 +168,6 @@
//
//
// LOG_W(M2AP,"pdu.present %d\n",pdu.present);
-// // MSC_LOG_TX_MESSAGE(
-// // MSC_M2AP_eNB,
-// // MSC_M2AP_MCE,
-// // (const char *)buffer,
-// // len,
-// // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
-// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
-// // m2ap_eNB_data_p->ENBname);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0);
//
// return 0;
@@ -315,8 +305,6 @@
//
// m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY;
//
-// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0);
//
// return ret;
@@ -371,11 +359,6 @@
// return -1;
// }
//
-// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB,
-// // MSC_M2AP_TARGET_ENB, NULL, 0,
-// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
-// // assoc_id, cause_type, cause_value);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
//
// return ret;
@@ -561,8 +544,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -654,8 +635,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -716,8 +695,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
//
// return ret;
@@ -800,8 +777,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
// return -1;
// }
//
-// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
-//
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
//
// return ret;
diff --git a/openair2/M2AP/m2ap_eNB_handler.c b/openair2/M2AP/m2ap_eNB_handler.c
index 9abc337408..7c4a9758da 100644
--- a/openair2/M2AP/m2ap_eNB_handler.c
+++ b/openair2/M2AP/m2ap_eNB_handler.c
@@ -44,7 +44,6 @@
//#include "m2ap_MCE_interface_management.h"
#include "m2ap_eNB_interface_management.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
diff --git a/openair2/M2AP/m2ap_eNB_interface_management.c b/openair2/M2AP/m2ap_eNB_interface_management.c
index 486e382e69..9bab800525 100644
--- a/openair2/M2AP/m2ap_eNB_interface_management.c
+++ b/openair2/M2AP/m2ap_eNB_interface_management.c
@@ -44,7 +44,6 @@
#include "m2ap_itti_messaging.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
@@ -255,15 +254,6 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
- // MSC_LOG_TX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_MCE,
- // (const char *)buffer,
- // len,
- // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // m2ap_eNB_data_p->ENBname);
-
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
return 0;
}
@@ -359,14 +349,6 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
- // MSC_LOG_TX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_MCE,
- // (const char *)buffer,
- // len,
- // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // m2ap_eNB_data_p->ENBname);
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
return 0;
@@ -531,14 +513,6 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
- // MSC_LOG_TX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_MCE,
- // (const char *)buffer,
- // len,
- // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // m2ap_eNB_data_p->ENBname);
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
return 0;
@@ -700,15 +674,6 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t*
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
- // MSC_LOG_TX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_MCE,
- // (const char *)buffer,
- // len,
- // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // m2ap_eNB_data_p->ENBname);
-
// buffer = &bytes[0];
// len = 40;
@@ -826,15 +791,6 @@ int eNB_handle_M2_SETUP_RESPONSE(instance_t instance,
//for (int i=0;i 0, "System Information %d is missing",i);
- //MSC_LOG_RX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_CU,
- // 0,
- // 0,
- // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // assoc_id);
-
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
//itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p2);
@@ -880,15 +836,6 @@ int eNB_handle_M2_SETUP_FAILURE(instance_t instance,
//for (int i=0;i 0, "System Information %d is missing",i);
- //MSC_LOG_RX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_CU,
- // 0,
- // 0,
- // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // assoc_id);
-
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
@@ -1025,15 +972,6 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
- // MSC_LOG_TX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_MCE,
- // (const char *)buffer,
- // len,
- // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // m2ap_eNB_data_p->ENBname);
-
// buffer = &bytes[0];
// len = 40;
@@ -1086,15 +1024,6 @@ int eNB_handle_eNB_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
//for (int i=0;i 0, "System Information %d is missing",i);
- //MSC_LOG_RX_MESSAGE(
- // MSC_M2AP_eNB,
- // MSC_M2AP_CU,
- // 0,
- // 0,
- // MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
- // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
- // assoc_id);
-
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
diff --git a/openair2/M2AP/m2ap_handler.c b/openair2/M2AP/m2ap_handler.c
index 1221bcedb5..6d8405db14 100644
--- a/openair2/M2AP/m2ap_handler.c
+++ b/openair2/M2AP/m2ap_handler.c
@@ -44,7 +44,6 @@
#include "m2ap_MCE_interface_management.h"
#include "m2ap_eNB_interface_management.h"
-#include "msc.h"
#include "assertions.h"
#include "conversions.h"
diff --git a/openair2/MCE_APP/mce_config.c b/openair2/MCE_APP/mce_config.c
index 439f2d2061..9d9d9028e5 100644
--- a/openair2/MCE_APP/mce_config.c
+++ b/openair2/MCE_APP/mce_config.c
@@ -54,8 +54,6 @@
#include "common/config/config_userapi.h"
#include "RRC_config_tools.h"
#include "enb_paramdef.h"
-#include "proto_agent.h"
-
#include "m3ap_MCE.h"
diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
index 57bb411dcc..2654988557 100644
--- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
+++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c
@@ -63,7 +63,7 @@ extern uint16_t sl_ahead;
void handle_nr_rach(NR_UL_IND_t *UL_info)
{
- if(NFAPI_MODE == NFAPI_MODE_PNF) {
+ if (NFAPI_MODE == NFAPI_MODE_PNF) {
if (UL_info->rach_ind.number_of_pdus > 0) {
LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
@@ -71,69 +71,29 @@ void handle_nr_rach(NR_UL_IND_t *UL_info)
}
return;
}
- NR_UL_IND_t UL_INFO;
- nfapi_nr_rach_indication_t *rach_ind = NULL;
- if (get_softmodem_params()->emulate_l1)
- {
- if (gnb_rach_ind_queue.num_items == 0)
- return;
- LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
- rach_ind = get_queue(&gnb_rach_ind_queue);
- UL_INFO.rach_ind = *rach_ind;
- UL_INFO.module_id = UL_info->module_id;
- UL_INFO.CC_id = UL_info->CC_id;
- }
- else
- {
- UL_INFO.rach_ind = UL_info->rach_ind;
- UL_INFO.module_id = UL_info->module_id;
- UL_INFO.CC_id = UL_info->CC_id;
- }
-
- int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn;
- if (frame_diff < 0)
- {
+ int frame_diff = UL_info->frame - UL_info->rach_ind.sfn;
+ if (frame_diff < 0) {
frame_diff += 1024;
}
bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7);
- if (UL_INFO.rach_ind.number_of_pdus>0 && in_timewindow) {
+ if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) {
LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",
- UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot);
- int npdus = UL_INFO.rach_ind.number_of_pdus;
- for(int i = 0; i < npdus; i++) {
- UL_INFO.rach_ind.number_of_pdus--;
+ UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot);
+ for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) {
UL_info->rach_ind.number_of_pdus--;
- if (UL_INFO.rach_ind.pdu_list[i].num_preamble>0)
- AssertFatal(UL_INFO.rach_ind.pdu_list[i].num_preamble==1,
- "More than 1 preamble not supported\n");
-
- nr_initiate_ra_proc(UL_INFO.module_id,
- UL_INFO.CC_id,
- UL_INFO.rach_ind.sfn,
- UL_INFO.rach_ind.slot,
- UL_INFO.rach_ind.pdu_list[i].preamble_list[0].preamble_index,
- UL_INFO.rach_ind.pdu_list[i].freq_index,
- UL_INFO.rach_ind.pdu_list[i].symbol_index,
- UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance);
+ AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble == 1, "More than 1 preamble not supported\n");
+ nr_initiate_ra_proc(UL_info->module_id,
+ UL_info->CC_id,
+ UL_info->rach_ind.sfn,
+ UL_info->rach_ind.slot,
+ UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index,
+ UL_info->rach_ind.pdu_list[i].freq_index,
+ UL_info->rach_ind.pdu_list[i].symbol_index,
+ UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance);
}
}
- if (get_softmodem_params()->emulate_l1)
- {
- if (rach_ind && rach_ind->number_of_pdus > 0)
- {
- for(int i = 0; i < rach_ind->number_of_pdus; i++)
- {
- free(rach_ind->pdu_list[i].preamble_list);
- rach_ind->pdu_list[i].preamble_list = NULL;
- }
- free(rach_ind->pdu_list);
- rach_ind->pdu_list = NULL;
- }
- free(rach_ind);
- rach_ind = NULL;
- }
}
@@ -148,26 +108,11 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
return;
}
- NR_UL_IND_t UL_INFO;
- nfapi_nr_uci_indication_t *uci_ind = NULL;
- if (get_softmodem_params()->emulate_l1)
- {
- if (gnb_uci_ind_queue.num_items == 0)
- return;
- LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
- uci_ind = get_queue(&gnb_uci_ind_queue);
- UL_INFO.uci_ind = *uci_ind;
- }
- else
- {
- UL_INFO.uci_ind = UL_info->uci_ind;
- }
-
const module_id_t mod_id = UL_info->module_id;
- const frame_t frame = UL_INFO.uci_ind.sfn;
- const sub_frame_t slot = UL_INFO.uci_ind.slot;
- int num_ucis = UL_INFO.uci_ind.num_ucis;
- nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list;
+ const frame_t frame = UL_info->uci_ind.sfn;
+ const sub_frame_t slot = UL_info->uci_ind.slot;
+ int num_ucis = UL_info->uci_ind.num_ucis;
+ nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list;
for (int i = 0; i < num_ucis; i++) {
switch (uci_list[i].pdu_type) {
@@ -178,7 +123,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n",
- UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size);
+ UL_info->uci_ind.sfn, UL_info->uci_ind.slot, num_ucis, uci_list[i].pdu_size);
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
break;
}
@@ -192,39 +137,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
}
}
- if (get_softmodem_params()->emulate_l1)
- {
- for (int i = 0; i < num_ucis; i++) {
- switch (uci_list[i].pdu_type) {
- case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
- if (uci_list[i].pucch_pdu_format_0_1.harq) {
- free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
- uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL;
- }
- free(uci_list[i].pucch_pdu_format_0_1.harq);
- uci_list[i].pucch_pdu_format_0_1.harq = NULL;
- free(uci_list[i].pucch_pdu_format_0_1.sr);
- uci_list[i].pucch_pdu_format_0_1.sr = NULL;
- break;
+ UL_info->uci_ind.num_ucis = 0;
- case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
- free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
- free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
- free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
- break;
- }
- }
- if (uci_ind && num_ucis > 0) {
- free(uci_list);
- uci_list = NULL;
- }
- free(uci_ind);
- uci_ind = NULL;
- }
- else
- {
- UL_info->uci_ind.num_ucis = 0;
- }
}
static bool crc_sfn_slot_matcher(void *wanted, void *candidate)
@@ -264,173 +178,202 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
return;
}
- NR_UL_IND_t UL_INFO;
- nfapi_nr_rx_data_indication_t *rx_ind = NULL;
- nfapi_nr_crc_indication_t *crc_ind = NULL;
- if (get_softmodem_params()->emulate_l1)
- {
- rx_ind = get_queue(&gnb_rx_ind_queue);
- if (!rx_ind)
- {
- LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n");
- return;
+ if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) {
+ AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs,
+ "number_of_pdus %d, number_crcs %d\n",
+ UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs);
+ for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) {
+ const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i];
+ const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i];
+ LOG_D(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x "
+ "UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
+ i, crc->rnti, i, rx->rnti);
+
+ AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n",
+ crc->rnti, rx->rnti);
+
+ LOG_D(NR_MAC,
+ "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
+ UL_info->frame,
+ UL_info->slot,
+ crc->tb_crc_status ? "error" : "ok",
+ crc->tb_crc_status);
+
+ /* if CRC passes, pass PDU, otherwise pass NULL as error indication */
+ nr_rx_sdu(UL_info->module_id,
+ UL_info->CC_id,
+ UL_info->rx_ind.sfn,
+ UL_info->rx_ind.slot,
+ rx->rnti,
+ crc->tb_crc_status ? NULL : rx->pdu,
+ rx->pdu_length,
+ rx->timing_advance,
+ rx->ul_cqi,
+ rx->rssi);
+ handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc);
}
-
- int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
-
- crc_ind = unqueue_matching(&gnb_crc_ind_queue,
- MAX_QUEUE_SIZE,
- crc_sfn_slot_matcher,
- &sfn_slot);
- if (!crc_ind)
- {
- LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
- put_queue(&gnb_rx_ind_queue, rx_ind);
- return;
- }
-
- UL_INFO.rx_ind = *rx_ind;
- UL_INFO.crc_ind = *crc_ind;
- UL_INFO.module_id = UL_info->module_id;
- UL_INFO.CC_id = UL_info->CC_id;
}
- else
+ UL_info->rx_ind.number_of_pdus = 0;
+ UL_info->crc_ind.number_crcs = 0;
+}
+
+static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind,
+ nfapi_nr_uci_indication_t *uci_ind,
+ nfapi_nr_rx_data_indication_t *rx_ind,
+ nfapi_nr_crc_indication_t *crc_ind) {
+ if (rach_ind && rach_ind->number_of_pdus > 0)
{
- UL_INFO.rx_ind = UL_info->rx_ind;
- UL_INFO.crc_ind = UL_info->crc_ind;
- UL_INFO.module_id = UL_info->module_id;
- UL_INFO.CC_id = UL_info->CC_id;
+ for(int i = 0; i < rach_ind->number_of_pdus; i++)
+ {
+ free_and_zero(rach_ind->pdu_list[i].preamble_list);
+ }
+ free_and_zero(rach_ind->pdu_list);
+ free_and_zero(rach_ind);
}
+ if (uci_ind && uci_ind->num_ucis > 0)
+ {
+ for (int i = 0; i < uci_ind->num_ucis; i++) {
+ switch (uci_ind->uci_list[i].pdu_type) {
+ case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
+ if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) {
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
+ }
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq);
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr);
+ break;
- UL_INFO.frame = UL_INFO.rx_ind.sfn;
- UL_INFO.slot = UL_INFO.rx_ind.slot;
- UL_INFO.module_id = UL_info->module_id;
- UL_INFO.CC_id = UL_info->CC_id;
- LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n",
- UL_info->frame, UL_info->slot,
- UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot,
- UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot
- );
+ case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
+ free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
+ break;
+ }
+ }
+ free_and_zero(uci_ind->uci_list);
+ free_and_zero(uci_ind);
+ }
+ if (rx_ind && rx_ind->number_of_pdus > 0)
+ {
+ free_and_zero(rx_ind->pdu_list);
+ free_and_zero(rx_ind);
+ }
+ if (crc_ind && crc_ind->number_crcs > 0)
+ {
+ free_and_zero(crc_ind->crc_list);
+ free_and_zero(crc_ind);
+ }
+}
- if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) {
- for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) {
- int j;
- for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) {
- // find crc_indication j corresponding rx_indication i
- const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i];
- const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j];
- LOG_D(NR_PHY,
- "UL_INFO.crc_ind.pdu_list[%d].rnti:%04x "
- "UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n",
- j,
- crc->rnti,
- i,
- rx->rnti);
+static void remove_crc_pdu(nfapi_nr_crc_indication_t *crc_ind, int index) {
+ AssertFatal(index >= 0, "Invalid index %d\n", index);
+ AssertFatal(index < crc_ind->number_crcs, "Invalid index %d\n", index);
+ AssertFatal(crc_ind->number_crcs > 0, "Invalid crc_ind->number_crcs %d\n", crc_ind->number_crcs);
- if (crc->rnti != rx->rnti)
- {
- LOG_D(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti);
- continue;
- }
+ memmove(crc_ind->crc_list + index,
+ crc_ind->crc_list + index + 1,
+ sizeof(*crc_ind->crc_list) * (crc_ind->number_crcs - index - 1));
+ crc_ind->number_crcs--;
+}
- LOG_D(NR_MAC,
- "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
- UL_INFO.frame,
- UL_INFO.slot,
- crc->tb_crc_status ? "error" : "ok",
- crc->tb_crc_status);
+static void remove_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, int index) {
+ AssertFatal(index >= 0, "Invalid index %d\n", index);
+ AssertFatal(index < rx_ind->number_of_pdus, "Invalid index %d\n", index);
+ AssertFatal(rx_ind->number_of_pdus > 0, "Invalid rx_ind->number_of_pdus %d\n", rx_ind->number_of_pdus);
- /* if CRC passes, pass PDU, otherwise pass NULL as error indication */
- nr_rx_sdu(UL_INFO.module_id,
- UL_INFO.CC_id,
- UL_INFO.rx_ind.sfn,
- UL_INFO.rx_ind.slot,
- rx->rnti,
- crc->tb_crc_status ? NULL : rx->pdu,
- rx->pdu_length,
- rx->timing_advance,
- rx->ul_cqi,
- rx->rssi);
- handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc);
+ memmove(rx_ind->pdu_list + index,
+ rx_ind->pdu_list + index + 1,
+ sizeof(*rx_ind->pdu_list) * (rx_ind->number_of_pdus - index - 1));
+ rx_ind->number_of_pdus--;
+}
+
+static bool crc_ind_has_rnti(nfapi_nr_crc_indication_t *crc_ind, uint16_t rnti) {
+ for (int i = 0; i < crc_ind->number_crcs; i++) {
+ if (rnti == crc_ind->crc_list[i].rnti) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool rx_ind_has_rnti(nfapi_nr_rx_data_indication_t *rx_ind, uint16_t rnti) {
+ for (int i = 0; i < rx_ind->number_of_pdus; i++) {
+ if (rnti == rx_ind->pdu_list[i].rnti) {
+ return true;
+ }
+ }
+ return false;
+}
+
+static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc_indication_t *crc_ind) {
+ AssertFatal(crc_ind->number_crcs > 0 && rx_ind->number_of_pdus > 0,
+ "Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n",
+ crc_ind->number_crcs, rx_ind->number_of_pdus);
+ if (crc_ind->number_crcs > rx_ind->number_of_pdus) {
+ int num_unmatched_crcs = 0;
+ nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched));
+ crc_ind_unmatched->header = crc_ind->header;
+ crc_ind_unmatched->sfn = crc_ind->sfn;
+ crc_ind_unmatched->slot = crc_ind->slot;
+ crc_ind_unmatched->number_crcs = crc_ind->number_crcs - rx_ind->number_of_pdus;
+ crc_ind_unmatched->crc_list = calloc(crc_ind_unmatched->number_crcs, sizeof(nfapi_nr_crc_t));
+ for (int i = 0; i < crc_ind->number_crcs; i++) {
+ if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) {
+ LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n",
+ i, crc_ind->crc_list[i].rnti);
+ crc_ind_unmatched->crc_list[num_unmatched_crcs] = crc_ind->crc_list[i];
+ num_unmatched_crcs++;
+ remove_crc_pdu(crc_ind, i);
+ }
+ if (crc_ind->number_crcs == rx_ind->number_of_pdus) {
break;
- } // for (j=0;jemulate_l1)
- {
- int last = UL_INFO.crc_ind.number_crcs - 1;
- if (j < last)
- {
- crc_ind->crc_list[j] = crc_ind->crc_list[last];
- UL_INFO.crc_ind.number_crcs--;
- }
- else if (j == last)
- {
- UL_INFO.crc_ind.number_crcs--;
- }
-
- last = UL_INFO.rx_ind.number_of_pdus - 1;
- if (i < last)
- {
- rx_ind->pdu_list[i] = rx_ind->pdu_list[last];
- UL_INFO.rx_ind.number_of_pdus--;
- i--;
- }
- else if (i == last)
- {
- UL_INFO.rx_ind.number_of_pdus--;
- }
- }
- } // for (i=0;iemulate_l1)
- {
- if (UL_INFO.crc_ind.number_crcs > 0)
- {
- crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs;
- requeue(&gnb_crc_ind_queue, crc_ind);
- }
-
- if (UL_INFO.rx_ind.number_of_pdus > 0)
- {
- rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus;
- requeue(&gnb_rx_ind_queue, rx_ind);
- }
-
- if (UL_INFO.crc_ind.number_crcs == 0)
- {
- free(crc_ind->crc_list);
- crc_ind->crc_list = NULL;
- free(crc_ind);
- crc_ind = NULL;
- }
- if (UL_INFO.rx_ind.number_of_pdus == 0)
- {
- free(rx_ind->pdu_list);
- rx_ind->pdu_list = NULL;
- free(rx_ind);
- rx_ind = NULL;
}
}
- else
+ AssertFatal(crc_ind_unmatched->number_crcs == num_unmatched_crcs, "crc_ind num_pdus %d doesnt match %d\n",
+ crc_ind_unmatched->number_crcs, num_unmatched_crcs);
+ if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched))
{
- UL_info->crc_ind.number_crcs = 0;
- UL_info->rx_ind.number_of_pdus = 0;
+ LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n");
+ free_and_zero(crc_ind_unmatched->crc_list);
+ free_and_zero(crc_ind_unmatched);
}
- } else if ((UL_INFO.rx_ind.number_of_pdus != 0)
- || (UL_INFO.crc_ind.number_crcs != 0)) {
- LOG_E(NR_PHY,
- "hoping not to have mis-match between CRC ind and RX ind - "
- "hopefully the missing message is coming shortly "
- "rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n",
- UL_INFO.rx_ind.number_of_pdus,
- UL_INFO.rx_ind.sfn,
- UL_INFO.rx_ind.slot,
- UL_INFO.crc_ind.number_crcs,
- UL_INFO.crc_ind.sfn,
- UL_INFO.crc_ind.slot);
+ }
+ else if (crc_ind->number_crcs < rx_ind->number_of_pdus) {
+ int num_unmatched_rxs = 0;
+ nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched));
+ rx_ind_unmatched->header = rx_ind->header;
+ rx_ind_unmatched->sfn = rx_ind->sfn;
+ rx_ind_unmatched->slot = rx_ind->slot;
+ rx_ind_unmatched->number_of_pdus = rx_ind->number_of_pdus - crc_ind->number_crcs;
+ rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t));
+ for (int i = 0; i < rx_ind->number_of_pdus; i++) {
+ if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) {
+ LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n",
+ i, rx_ind->pdu_list[i].rnti);
+ rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i];
+ num_unmatched_rxs++;
+ remove_rx_pdu(rx_ind, i);
+ }
+ if (rx_ind->number_of_pdus == crc_ind->number_crcs) {
+ break;
+ }
+ }
+ AssertFatal(rx_ind_unmatched->number_of_pdus == num_unmatched_rxs, "rx_ind num_pdus %d doesnt match %d\n",
+ rx_ind_unmatched->number_of_pdus, num_unmatched_rxs);
+ if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched))
+ {
+ LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n");
+ free_and_zero(rx_ind_unmatched->pdu_list);
+ free_and_zero(rx_ind_unmatched);
+ }
+ }
+ else {
+ LOG_E(NR_MAC, "The number of crc pdus %d = the number of rx pdus %d\n",
+ crc_ind->number_crcs, rx_ind->number_of_pdus);
}
}
void NR_UL_indication(NR_UL_IND_t *UL_info) {
- AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
+ AssertFatal(UL_info!=NULL,"UL_info is null\n");
#ifdef DUMP_FAPI
dump_ul(UL_info);
#endif
@@ -440,17 +383,63 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
NR_IF_Module_t *ifi = nr_if_inst[module_id];
gNB_MAC_INST *mac = RC.nrmac[module_id];
LOG_D(NR_PHY,"SFN/SLOT:%d.%d module_id:%d CC_id:%d UL_info[rach_pdus:%zu rx_ind:%zu crcs:%zu]\n",
- UL_info->frame,UL_info->slot,
- module_id,CC_id, gnb_rach_ind_queue.num_items,
- gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
+ UL_info->frame, UL_info->slot,
+ module_id, CC_id,
+ gnb_rach_ind_queue.num_items,
+ gnb_rx_ind_queue.num_items,
+ gnb_crc_ind_queue.num_items);
+
+ nfapi_nr_rach_indication_t *rach_ind = NULL;
+ nfapi_nr_uci_indication_t *uci_ind = NULL;
+ nfapi_nr_rx_data_indication_t *rx_ind = NULL;
+ nfapi_nr_crc_indication_t *crc_ind = NULL;
+ if (get_softmodem_params()->emulate_l1)
+ {
+ if (gnb_rach_ind_queue.num_items > 0) {
+ LOG_D(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
+ rach_ind = get_queue(&gnb_rach_ind_queue);
+ AssertFatal(rach_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
+ UL_info->rach_ind = *rach_ind;
+ }
+ if (gnb_uci_ind_queue.num_items > 0) {
+ LOG_D(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
+ uci_ind = get_queue(&gnb_uci_ind_queue);
+ AssertFatal(uci_ind->num_ucis > 0, "Invalid number of PDUs\n");
+ UL_info->uci_ind = *uci_ind;
+ }
+ if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) {
+ LOG_D(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n",
+ gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
+ rx_ind = get_queue(&gnb_rx_ind_queue);
+ int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
+ crc_ind = unqueue_matching(&gnb_crc_ind_queue,
+ MAX_QUEUE_SIZE,
+ crc_sfn_slot_matcher,
+ &sfn_slot);
+ if (!crc_ind) {
+ LOG_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
+ requeue(&gnb_rx_ind_queue, rx_ind);
+ }
+ else {
+ AssertFatal(rx_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
+ AssertFatal(crc_ind->number_crcs > 0, "Invalid number of PDUs\n");
+ if (crc_ind->number_crcs != rx_ind->number_of_pdus)
+ match_crc_rx_pdu(rx_ind, crc_ind);
+ UL_info->rx_ind = *rx_ind;
+ UL_info->crc_ind = *crc_ind;
+ }
+ }
+ }
handle_nr_rach(UL_info);
-
handle_nr_uci(UL_info);
// clear UL DCI prior to handling ULSCH
mac->UL_dci_req[CC_id].numPdus = 0;
handle_nr_ulsch(UL_info);
+ if (get_softmodem_params()->emulate_l1) {
+ free_unqueued_nfapi_indications(rach_ind, uci_ind, rx_ind, crc_ind);
+ }
if (NFAPI_MODE != NFAPI_MODE_PNF) {
if (ifi->CC_mask==0) {
diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
index c7b54950d7..9bce0e8843 100644
--- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
@@ -30,6 +30,10 @@
* \warning
*/
+#include