Merge branch 'develop_integration_2019_w11' into 'develop'
Develop integration 2019 week 11 See merge request oai/openairinterface5g!538 Following Merge Requests were merged: - MR 527: eMTC testing - MR 537: x2ap: timers and cleanup
This commit is contained in:
@@ -33,15 +33,18 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
|
||||
def doRedHatBuild = false
|
||||
def doFlexranCtrlTest = false
|
||||
|
||||
// Location of the executor node
|
||||
def nodeExecutor = params.nodeExecutor
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'bellatrix'
|
||||
label nodeExecutor
|
||||
}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-FDD-Band7", "Test-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40"])
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13"])
|
||||
ansiColor('xterm')
|
||||
}
|
||||
|
||||
@@ -393,7 +396,7 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
gitlabCommitStatus(name: "Test-FDD-Band7") {
|
||||
gitlabCommitStatus(name: "Test-Mono-FDD-Band7") {
|
||||
build job: 'eNB-CI-FDD-Band7-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
@@ -404,7 +407,7 @@ pipeline {
|
||||
]
|
||||
}
|
||||
} else {
|
||||
gitlabCommitStatus(name: "Test-FDD-Band7") {
|
||||
gitlabCommitStatus(name: "Test-Mono-FDD-Band7") {
|
||||
build job: 'eNB-CI-FDD-Band7-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
@@ -444,7 +447,7 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
gitlabCommitStatus(name: "Test-TDD-Band40") {
|
||||
gitlabCommitStatus(name: "Test-Mono-TDD-Band40") {
|
||||
build job: 'eNB-CI-TDD-Band40-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
@@ -455,7 +458,7 @@ pipeline {
|
||||
]
|
||||
}
|
||||
} else {
|
||||
gitlabCommitStatus(name: "Test-TDD-Band40") {
|
||||
gitlabCommitStatus(name: "Test-Mono-TDD-Band40") {
|
||||
build job: 'eNB-CI-TDD-Band40-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
@@ -593,6 +596,57 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test MONOLITHIC - FDD - Band 13 - B210") {
|
||||
steps {
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
gitlabCommitStatus(name: "Test-Mono-FDD-Band13") {
|
||||
build job: 'eNB-CI-MONO-FDD-Band13-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
|
||||
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true),
|
||||
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
|
||||
]
|
||||
}
|
||||
} else {
|
||||
gitlabCommitStatus(name: "Test-Mono-FDD-Band13") {
|
||||
build job: 'eNB-CI-MONO-FDD-Band13-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
|
||||
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
|
||||
booleanParam(name: 'eNB_mergeRequest', value: false)
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
// In case of any non-success, we are retrieving the HTML report of the last completed
|
||||
// slave job.
|
||||
// The only drop-back is that we may retrieve the HTML report of a previous build
|
||||
always {
|
||||
script {
|
||||
if (!fileExists('test_results-eNB-CI-MONO-FDD-Band13-B210.html')) {
|
||||
copyArtifacts(projectName: 'eNB-CI-MONO-FDD-Band13-B210',
|
||||
filter: 'test_results*.html',
|
||||
selector: lastCompleted())
|
||||
if (fileExists('test_results-eNB-CI-MONO-FDD-Band13-B210.html')) {
|
||||
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' test_results-eNB-CI-MONO-FDD-Band13-B210.html"
|
||||
archiveArtifacts artifacts: 'test_results-eNB-CI-MONO-FDD-Band13-B210.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
||||
@@ -13,9 +13,9 @@ eNBs =
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2;} );
|
||||
plmn_list = ( { mcc = 208; mnc = 92; mnc_length = 2;} );
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
@@ -48,10 +48,10 @@ eNBs =
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 1;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
@@ -190,7 +190,7 @@ eNBs =
|
||||
prach_freq_offset = 1;
|
||||
|
||||
#PDSCH Config Common
|
||||
pdsch_referenceSignalPower = -27
|
||||
pdsch_referenceSignalPower = -24
|
||||
pdsch_p_b = 0;
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
@@ -262,7 +262,7 @@ eNBs =
|
||||
n1PUCCH_AN_InfoList_r13 =
|
||||
(
|
||||
{
|
||||
pucch_info_value = 0;
|
||||
pucch_info_value = 33;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -360,6 +360,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
@@ -406,6 +411,7 @@ L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
prach_dtx_threshold = 200;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -417,12 +423,31 @@ RUs = (
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [13];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 125;
|
||||
max_pdschReferenceSignalPower = -24;
|
||||
max_rxgain = 110;
|
||||
eNB_instances = [0];
|
||||
}
|
||||
);
|
||||
|
||||
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";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "lo";
|
||||
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -181,6 +181,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -144,6 +144,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -144,6 +144,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -144,6 +144,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -181,6 +181,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -181,6 +181,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -181,6 +181,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -179,6 +179,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "ens3";
|
||||
|
||||
+180
-16
@@ -100,6 +100,8 @@ class SSHConnection():
|
||||
self.Initialize_eNB_args = ''
|
||||
self.eNBLogFile = ''
|
||||
self.eNB_instance = ''
|
||||
self.eNBOptions = ''
|
||||
self.rruOptions = ''
|
||||
self.ping_args = ''
|
||||
self.ping_packetloss_threshold = ''
|
||||
self.iperf_args = ''
|
||||
@@ -123,6 +125,7 @@ class SSHConnection():
|
||||
self.eNBOsVersion = ''
|
||||
self.eNBKernelVersion = ''
|
||||
self.eNBUhdVersion = ''
|
||||
self.eNBUsrpBoard = ''
|
||||
self.eNBCpuNb = ''
|
||||
self.eNBCpuModel = ''
|
||||
self.eNBCpuMHz = ''
|
||||
@@ -408,14 +411,10 @@ class SSHConnection():
|
||||
self.command('echo $USER; nohup sudo tshark -f "host ' + self.eNBIPAddress +'" -i ' + eth_interface + ' -w /tmp/enb_' + self.testCase_id + '_s1log.pcap > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5)
|
||||
self.close()
|
||||
self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5)
|
||||
result = re.search('type: b200', str(self.ssh.before))
|
||||
if result is not None:
|
||||
logging.debug('Found a B2xx device --> resetting it')
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S sudo b2xx_fx3_utils --reset-device', '\$', 5)
|
||||
self.command('cd ' + self.eNBSourceCodePath, '\$', 5)
|
||||
# Initialize_eNB_args usually start with -O and followed by the location in repository
|
||||
full_config_file = self.Initialize_eNB_args.replace('-O ','')
|
||||
extra_options = ''
|
||||
extIdx = full_config_file.find('.conf')
|
||||
if (extIdx > 0):
|
||||
extra_options = full_config_file[extIdx + 5:]
|
||||
@@ -436,6 +435,16 @@ class SSHConnection():
|
||||
result = re.search('rru', str(config_file))
|
||||
if result is not None:
|
||||
rruCheck = True
|
||||
# do not reset board twice in IF4.5 case
|
||||
result = re.search('rru|enb', str(config_file))
|
||||
if result is not None:
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5)
|
||||
result = re.search('type: b200', str(self.ssh.before))
|
||||
if result is not None:
|
||||
logging.debug('Found a B2xx device --> resetting it')
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S sudo b2xx_fx3_utils --reset-device', '\$', 5)
|
||||
# Reloading FGPA bin firmware
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5)
|
||||
# Make a copy and adapt to EPC / eNB IP addresses
|
||||
self.command('cp ' + full_config_file + ' ' + ci_full_config_file, '\$', 5)
|
||||
self.command('sed -i -e \'s/CI_MME_IP_ADDR/' + self.EPCIPAddress + '/\' ' + ci_full_config_file, '\$', 2);
|
||||
@@ -449,6 +458,8 @@ class SSHConnection():
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
|
||||
if not rruCheck:
|
||||
self.eNBLogFile = 'enb_' + self.testCase_id + '.log'
|
||||
if extra_options != '':
|
||||
self.eNBOptions = extra_options
|
||||
time.sleep(6)
|
||||
doLoop = True
|
||||
loopCounter = 10
|
||||
@@ -487,6 +498,8 @@ class SSHConnection():
|
||||
time.sleep(6)
|
||||
else:
|
||||
doLoop = False
|
||||
if rruCheck and extra_options != '':
|
||||
self.rruOptions = extra_options
|
||||
self.CreateHtmlTestRow('-O ' + config_file + extra_options, 'OK', ALL_PROCESSES_OK)
|
||||
logging.debug('\u001B[1m Initialize eNB Completed\u001B[0m')
|
||||
|
||||
@@ -609,21 +622,150 @@ class SSHConnection():
|
||||
time.sleep(4)
|
||||
# We should check if we register
|
||||
count = 0
|
||||
while count < 3:
|
||||
attach_cnt = 0
|
||||
attach_status = False
|
||||
while count < 5:
|
||||
self.command('AT+CEREG?', 'OK', 5)
|
||||
result = re.search('CEREG: 2,(?P<state>[0-9\-]+)', str(self.ssh.before))
|
||||
result = re.search('CEREG: 2,(?P<state>[0-9\-]+),', str(self.ssh.before))
|
||||
if result is not None:
|
||||
mDataConnectionState = int(result.group('state'))
|
||||
if mDataConnectionState is not None:
|
||||
logging.debug('+CEREG: 2,' + str(mDataConnectionState))
|
||||
if mDataConnectionState == 1:
|
||||
count = 10
|
||||
attach_status = True
|
||||
result = re.search('CEREG: 2,1,"(?P<networky>[0-9A-Z]+)","(?P<networkz>[0-9A-Z]+)"', str(self.ssh.before))
|
||||
if result is not None:
|
||||
networky = result.group('networky')
|
||||
networkz = result.group('networkz')
|
||||
logging.debug('\u001B[1m CAT-M module attached to eNB (' + str(networky) + '/' + str(networkz) + ')\u001B[0m')
|
||||
else:
|
||||
logging.debug('\u001B[1m CAT-M module attached to eNB\u001B[0m')
|
||||
else:
|
||||
logging.debug('+CEREG: 2,' + str(mDataConnectionState))
|
||||
attach_cnt = attach_cnt + 1
|
||||
else:
|
||||
logging.debug(str(self.ssh.before))
|
||||
attach_cnt = attach_cnt + 1
|
||||
count = count + 1
|
||||
time.sleep(1)
|
||||
if attach_status:
|
||||
self.command('AT+CESQ', 'OK', 5)
|
||||
result = re.search('CESQ: 99,99,255,255,(?P<rsrq>[0-9]+),(?P<rsrp>[0-9]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
nRSRQ = int(result.group('rsrq'))
|
||||
nRSRP = int(result.group('rsrp'))
|
||||
if (nRSRQ is not None) and (nRSRP is not None):
|
||||
logging.debug(' RSRQ = ' + str(-20+(nRSRQ/2)) + ' dB')
|
||||
logging.debug(' RSRP = ' + str(-140+nRSRP) + ' dBm')
|
||||
self.close()
|
||||
self.picocom_closure = False
|
||||
self.CreateHtmlTestRow('N/A', 'OK', ALL_PROCESSES_OK)
|
||||
html_queue = SimpleQueue()
|
||||
self.checkDevTTYisUnlocked()
|
||||
if attach_status:
|
||||
html_cell = '<pre style="background-color:white">CAT-M module\nAttachment Completed in ' + str(attach_cnt+4) + ' seconds'
|
||||
if (nRSRQ is not None) and (nRSRP is not None):
|
||||
html_cell += '\n RSRQ = ' + str(-20+(nRSRQ/2)) + ' dB'
|
||||
html_cell += '\n RSRP = ' + str(-140+nRSRP) + ' dBm</pre>'
|
||||
else:
|
||||
html_cell += '</pre>'
|
||||
html_queue.put(html_cell)
|
||||
self.CreateHtmlTestRowQueue('N/A', 'OK', 1, html_queue)
|
||||
else:
|
||||
html_cell = '<pre style="background-color:white">CAT-M module\nAttachment Failed</pre>'
|
||||
html_queue.put(html_cell)
|
||||
self.CreateHtmlTestRowQueue('N/A', 'KO', 1, html_queue)
|
||||
|
||||
def PingCatM(self):
|
||||
if self.EPCIPAddress == '' or self.EPCUserName == '' or self.EPCPassword == '' or self.EPCSourceCodePath == '':
|
||||
Usage()
|
||||
sys.exit('Insufficient Parameter')
|
||||
initialize_eNB_flag = False
|
||||
pStatus = self.CheckProcessExist(initialize_eNB_flag)
|
||||
if (pStatus < 0):
|
||||
self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
|
||||
self.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
try:
|
||||
statusQueue = SimpleQueue()
|
||||
lock = Lock()
|
||||
self.open(self.EPCIPAddress, self.EPCUserName, self.EPCPassword)
|
||||
self.command('cd ' + self.EPCSourceCodePath, '\$', 5)
|
||||
self.command('cd scripts', '\$', 5)
|
||||
if re.match('OAI', self.EPCType, re.IGNORECASE):
|
||||
logging.debug('Using the OAI EPC HSS: not implemented yet')
|
||||
self.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
|
||||
self.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
else:
|
||||
self.command('egrep --color=never "Allocated ipv4 addr" /opt/ltebox/var/log/xGwLog.0', '\$', 5)
|
||||
result = re.search('Allocated ipv4 addr: (?P<ipaddr>[0-9\.]+) from Pool', str(self.ssh.before))
|
||||
if result is not None:
|
||||
moduleIPAddr = result.group('ipaddr')
|
||||
else:
|
||||
return
|
||||
ping_time = re.findall("-c (\d+)",str(self.ping_args))
|
||||
device_id = 'catm'
|
||||
ping_status = self.command('stdbuf -o0 ping ' + self.ping_args + ' ' + str(moduleIPAddr) + ' 2>&1 | stdbuf -o0 tee -a ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
|
||||
# TIMEOUT CASE
|
||||
if ping_status < 0:
|
||||
message = 'Ping with UE (' + str(moduleIPAddr) + ') crashed due to TIMEOUT!'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message)
|
||||
return
|
||||
result = re.search(', (?P<packetloss>[0-9\.]+)% packet loss, time [0-9\.]+ms', str(self.ssh.before))
|
||||
if result is None:
|
||||
message = 'Packet Loss Not Found!'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message)
|
||||
return
|
||||
packetloss = result.group('packetloss')
|
||||
if float(packetloss) == 100:
|
||||
message = 'Packet Loss is 100%'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message)
|
||||
return
|
||||
result = re.search('rtt min\/avg\/max\/mdev = (?P<rtt_min>[0-9\.]+)\/(?P<rtt_avg>[0-9\.]+)\/(?P<rtt_max>[0-9\.]+)\/[0-9\.]+ ms', str(self.ssh.before))
|
||||
if result is None:
|
||||
message = 'Ping RTT_Min RTT_Avg RTT_Max Not Found!'
|
||||
logging.debug('\u001B[1;37;41m ' + message + ' \u001B[0m')
|
||||
self.ping_iperf_wrong_exit(lock, moduleIPAddr, device_id, statusQueue, message)
|
||||
return
|
||||
rtt_min = result.group('rtt_min')
|
||||
rtt_avg = result.group('rtt_avg')
|
||||
rtt_max = result.group('rtt_max')
|
||||
pal_msg = 'Packet Loss : ' + packetloss + '%'
|
||||
min_msg = 'RTT(Min) : ' + rtt_min + ' ms'
|
||||
avg_msg = 'RTT(Avg) : ' + rtt_avg + ' ms'
|
||||
max_msg = 'RTT(Max) : ' + rtt_max + ' ms'
|
||||
lock.acquire()
|
||||
logging.debug('\u001B[1;37;44m ping result (' + moduleIPAddr + ') \u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m')
|
||||
logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m')
|
||||
qMsg = pal_msg + '\n' + min_msg + '\n' + avg_msg + '\n' + max_msg
|
||||
packetLossOK = True
|
||||
if packetloss is not None:
|
||||
if float(packetloss) > float(self.ping_packetloss_threshold):
|
||||
qMsg += '\nPacket Loss too high'
|
||||
logging.debug('\u001B[1;37;41m Packet Loss too high \u001B[0m')
|
||||
packetLossOK = False
|
||||
elif float(packetloss) > 0:
|
||||
qMsg += '\nPacket Loss is not 0%'
|
||||
logging.debug('\u001B[1;30;43m Packet Loss is not 0% \u001B[0m')
|
||||
lock.release()
|
||||
self.close()
|
||||
html_cell = '<pre style="background-color:white">CAT-M module\nIP Address : ' + moduleIPAddr + '\n' + qMsg + '</pre>'
|
||||
statusQueue.put(html_cell)
|
||||
if (packetLossOK):
|
||||
self.CreateHtmlTestRowQueue(self.ping_args, 'OK', 1, statusQueue)
|
||||
else:
|
||||
self.CreateHtmlTestRowQueue(self.ping_args, 'KO', 1, statusQueue)
|
||||
self.AutoTerminateUEandeNB()
|
||||
self.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
except:
|
||||
os.kill(os.getppid(),signal.SIGUSR1)
|
||||
|
||||
def AttachUE_common(self, device_id, statusQueue, lock):
|
||||
try:
|
||||
@@ -1620,7 +1762,18 @@ class SSHConnection():
|
||||
uciStatMsgCount = 0
|
||||
pdcpFailure = 0
|
||||
ulschFailure = 0
|
||||
self.htmleNBFailureMsg = ''
|
||||
for line in enb_log_file.readlines():
|
||||
if self.rruOptions != '':
|
||||
res1 = re.search('max_rxgain (?P<requested_option>[0-9]+)', self.rruOptions)
|
||||
res2 = re.search('max_rxgain (?P<applied_option>[0-9]+)', str(line))
|
||||
if res1 is not None and res2 is not None:
|
||||
requested_option = int(res1.group('requested_option'))
|
||||
applied_option = int(res2.group('applied_option'))
|
||||
if requested_option == applied_option:
|
||||
self.htmleNBFailureMsg += '<span class="glyphicon glyphicon-ok-circle"></span> Command line option(s) correctly applied <span class="glyphicon glyphicon-arrow-right"></span> ' + self.rruOptions + '\n\n'
|
||||
else:
|
||||
self.htmleNBFailureMsg += '<span class="glyphicon glyphicon-ban-circle"></span> Command line option(s) NOT applied <span class="glyphicon glyphicon-arrow-right"></span> ' + self.rruOptions + '\n\n'
|
||||
result = re.search('[Ss]egmentation [Ff]ault', str(line))
|
||||
if result is not None:
|
||||
foundSegFault = True
|
||||
@@ -1676,7 +1829,6 @@ class SSHConnection():
|
||||
if result is not None:
|
||||
rachCanceledProcedure += 1
|
||||
enb_log_file.close()
|
||||
self.htmleNBFailureMsg = ''
|
||||
if uciStatMsgCount > 0:
|
||||
statMsg = 'eNB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)'
|
||||
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
|
||||
@@ -1974,6 +2126,7 @@ class SSHConnection():
|
||||
self.eNBOsVersion = 'Ubuntu 16.04.5 LTS'
|
||||
self.eNBKernelVersion = '4.15.0-45-generic'
|
||||
self.eNBUhdVersion = '3.13.0.1-0'
|
||||
self.eNBUsrpBoard = 'B210'
|
||||
self.eNBCpuNb = '4'
|
||||
self.eNBCpuModel = 'Intel(R) Core(TM) i5-6200U'
|
||||
self.eNBCpuMHz = '2399.996 MHz'
|
||||
@@ -1997,6 +2150,11 @@ class SSHConnection():
|
||||
if result is not None:
|
||||
self.eNBUhdVersion = result.group('uhd_version')
|
||||
logging.debug('UHD Version is: ' + self.eNBUhdVersion)
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 5)
|
||||
result = re.search('product: (?P<usrp_board>[0-9A-Za-z]+)\\\\r\\\\n', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.eNBUsrpBoard = result.group('usrp_board')
|
||||
logging.debug('USRP Board is: ' + self.eNBUsrpBoard)
|
||||
self.command('lscpu', '\$', 5)
|
||||
result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
@@ -2174,7 +2332,7 @@ class SSHConnection():
|
||||
self.htmlFile.write(' <p></p>\n')
|
||||
self.htmlFile.write(' <table class="table table-condensed">\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th colspan=6>eNB Server Characteristics</th>\n')
|
||||
self.htmlFile.write(' <th colspan=8>eNB Server Characteristics</th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td>OS Version</td>\n')
|
||||
@@ -2183,6 +2341,8 @@ class SSHConnection():
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBKernelVersion + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>UHD Version</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBUhdVersion + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>USRP Board</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBUsrpBoard + '</span></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td>Nb CPUs</td>\n')
|
||||
@@ -2191,13 +2351,15 @@ class SSHConnection():
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBCpuModel + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>CPU Frequency</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBCpuMHz + '</span></td>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' <td></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th colspan=4 bgcolor = "#33CCFF">Final Status</th>\n')
|
||||
self.htmlFile.write(' <th colspan=5 bgcolor = "#33CCFF">Final Status</th>\n')
|
||||
if passStatus:
|
||||
self.htmlFile.write(' <th colspan=2 bgcolor="green"><font color="white">PASS <span class="glyphicon glyphicon-ok"></span></font></th>\n')
|
||||
self.htmlFile.write(' <th colspan=3 bgcolor="green"><font color="white">PASS <span class="glyphicon glyphicon-ok"></span></font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th colspan=2 bgcolor="red"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' <th colspan=3 bgcolor="red"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
self.htmlFile.write(' <p></p>\n')
|
||||
@@ -2331,7 +2493,7 @@ def Usage():
|
||||
print('------------------------------------------------------------')
|
||||
|
||||
def CheckClassValidity(action,id):
|
||||
if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'IdleSleep':
|
||||
if action != 'Build_eNB' and action != 'Initialize_eNB' and action != 'Terminate_eNB' and action != 'Initialize_UE' and action != 'Terminate_UE' and action != 'Attach_UE' and action != 'Detach_UE' and action != 'Ping' and action != 'Iperf' and action != 'Reboot_UE' and action != 'Initialize_HSS' and action != 'Terminate_HSS' and action != 'Initialize_MME' and action != 'Terminate_MME' and action != 'Initialize_SPGW' and action != 'Terminate_SPGW' and action != 'Initialize_CatM_module' and action != 'Terminate_CatM_module' and action != 'Attach_CatM_module' and action != 'Detach_CatM_module' and action != 'Ping_CatM_module' and action != 'IdleSleep':
|
||||
logging.debug('ERROR: test-case ' + id + ' has wrong class ' + action)
|
||||
return False
|
||||
return True
|
||||
@@ -2358,7 +2520,7 @@ def GetParametersFromXML(action):
|
||||
else:
|
||||
SSH.nbMaxUEtoAttach = int(nbMaxUEtoAttach)
|
||||
|
||||
if action == 'Ping':
|
||||
if action == 'Ping' or action == 'Ping_CatM_module':
|
||||
SSH.ping_args = test.findtext('ping_args')
|
||||
SSH.ping_packetloss_threshold = test.findtext('ping_packetloss_threshold')
|
||||
|
||||
@@ -2656,6 +2818,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE):
|
||||
SSH.AttachCatM()
|
||||
elif action == 'Detach_CatM_module':
|
||||
SSH.TerminateCatM()
|
||||
elif action == 'Ping_CatM_module':
|
||||
SSH.PingCatM()
|
||||
elif action == 'Ping':
|
||||
SSH.Ping()
|
||||
elif action == 'Iperf':
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<!--
|
||||
|
||||
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
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>build-tab</htmlTabRef>
|
||||
<htmlTabName>Build</htmlTabName>
|
||||
<htmlTabIcon>wrench</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
010101
|
||||
050101 060101 070101
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList>
|
||||
</TestCaseExclusionList>
|
||||
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050101">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="060101">
|
||||
<class>Initialize_MME</class>
|
||||
<desc>Initialize MME</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070101">
|
||||
<class>Initialize_SPGW</class>
|
||||
<desc>Initialize SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -0,0 +1,47 @@
|
||||
<!--
|
||||
|
||||
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
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>epc-closure</htmlTabRef>
|
||||
<htmlTabName>EPC-Closure</htmlTabName>
|
||||
<htmlTabIcon>log-out</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
050201 060201 070201
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="050201">
|
||||
<class>Terminate_HSS</class>
|
||||
<desc>Terminate HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="060201">
|
||||
<class>Terminate_MME</class>
|
||||
<desc>Terminate MME</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070201">
|
||||
<class>Terminate_SPGW</class>
|
||||
<desc>Terminate SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -0,0 +1,78 @@
|
||||
<!--
|
||||
|
||||
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
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-10-tm1</htmlTabRef>
|
||||
<htmlTabName>Test-10MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
040102
|
||||
030121 000001 040302 000001 040502 000001 040402 040202 000001 030201
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList>
|
||||
</TestCaseExclusionList>
|
||||
|
||||
<testCase id="000001">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Waiting for a moment...</desc>
|
||||
<idle_sleep_time_in_sec>15</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030121">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band13/10MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band13.tm1.50PRB.emtc.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Terminate_eNB</class>
|
||||
<desc>Terminate eNB</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040102">
|
||||
<class>Initialize_CatM_module</class>
|
||||
<desc>Initialize CAT-M Module</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040202">
|
||||
<class>Terminate_CatM_module</class>
|
||||
<desc>Terminate CAT-M Module</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040302">
|
||||
<class>Attach_CatM_module</class>
|
||||
<desc>Attach CAT-M Module</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040402">
|
||||
<class>Detach_CatM_module</class>
|
||||
<desc>Detach CAT-M Module</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040502">
|
||||
<class>Ping_CatM_module</class>
|
||||
<desc>ping (10MHz - 20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -34,7 +34,7 @@
|
||||
<testCase id="030104">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize RRU (TDD/Band40)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.tdd.band40.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 125</Initialize_eNB_args>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<testCase id="030114">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize RRU (TDD/Band40)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.tdd.band40.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.tdd.band40.conf --RUs.[0].max_rxgain 120</Initialize_eNB_args>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize RRU (FDD/Band7)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.fdd.band7.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 125</Initialize_eNB_args>
|
||||
<eNB_instance>1</eNB_instance>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<testCase id="030111">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize RRU (FDD/Band7)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.fdd.band7.conf</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/rru.fdd.band7.conf --RUs.[0].max_rxgain 120</Initialize_eNB_args>
|
||||
<eNB_instance>1</eNB_instance>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -471,6 +471,7 @@ add_library(X2AP_ENB
|
||||
${X2AP_DIR}/x2ap_eNB_management_procedures.c
|
||||
${X2AP_DIR}/x2ap_eNB_generate_messages.c
|
||||
${X2AP_DIR}/x2ap_ids.c
|
||||
${X2AP_DIR}/x2ap_timers.c
|
||||
)
|
||||
add_dependencies(X2AP_ENB rrc_flag x2_flag)
|
||||
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -141,6 +141,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -143,6 +143,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
|
||||
|
||||
@@ -143,6 +143,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
|
||||
|
||||
@@ -143,6 +143,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth3";
|
||||
|
||||
@@ -181,6 +181,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1";
|
||||
|
||||
@@ -127,6 +127,9 @@ The X2AP layer is based on **3GPP 36.423** v14.6.0 and implements the following
|
||||
- X2 Setup Failure
|
||||
- Handover Request
|
||||
- Handover Request Acknowledge
|
||||
- UE Context Release
|
||||
- X2 timers (t_reloc_prep, tx2_reloc_overall)
|
||||
- Handover Cancel
|
||||
|
||||
## eNB Advanced Features ##
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -71,28 +71,24 @@ void dci_encoding(uint8_t *a,
|
||||
uint8_t w[3*3*(MAX_DCI_SIZE_BITS+16)];
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
int32_t i;
|
||||
#endif
|
||||
// encode dci
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
printf("Doing DCI encoding for %d bits, e %p, rnti %x, E %d\n",A,e,rnti,E);
|
||||
#endif
|
||||
// encode dci
|
||||
memset((void *)d,LTE_NULL,96);
|
||||
ccodelte_encode(A,2,a,d+96,rnti);
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
|
||||
for (i=0; i<16+A; i++)
|
||||
printf("%d : (%d,%d,%d)\n",i,*(d+96+(3*i)),*(d+97+(3*i)),*(d+98+(3*i)));
|
||||
|
||||
#endif
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
printf("Doing DCI interleaving for %d coded bits, e %p\n",D*3,e);
|
||||
#endif
|
||||
|
||||
RCC = sub_block_interleaving_cc(D,d+96,w);
|
||||
|
||||
//#ifdef DEBUG_DCI_ENCODING
|
||||
#ifdef DEBUG_DCI_ENCODING
|
||||
if (E>1000) printf("Doing DCI rate matching for %d channel bits, RCC %d, e %p\n",E,RCC,e);
|
||||
#endif
|
||||
|
||||
//#endif
|
||||
lte_rate_matching_cc(RCC,E,w,e);
|
||||
}
|
||||
|
||||
|
||||
@@ -300,7 +300,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
|
||||
dlsch0 = eNB->dlsch[UE_id][0];
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
|
||||
|
||||
dlsch0->ue_type = 0;
|
||||
dlsch1->ue_type = 0;
|
||||
beamforming_mode = eNB->transmission_mode[(uint8_t)UE_id]<7?0:eNB->transmission_mode[(uint8_t)UE_id];
|
||||
dlsch0_harq = dlsch0->harq_processes[rel8->harq_process];
|
||||
dlsch0_harq->codeword = 0;
|
||||
@@ -527,7 +528,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t
|
||||
|
||||
dlsch0->harq_mask |= (1 << rel8->harq_process);
|
||||
|
||||
if (rel8->rnti_type == 1) LOG_I(PHY,"DCI 1A: round %d, mcs %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
|
||||
if (rel8->rnti_type == 1) LOG_D(PHY,"DCI 1A: round %d, mcs %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
|
||||
|
||||
break;
|
||||
case NFAPI_DL_DCI_FORMAT_1:
|
||||
@@ -1559,7 +1560,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
|
||||
case 10: // Format 6-1A
|
||||
dci_alloc->format = format6_1A;
|
||||
dlsch0->active = 1;
|
||||
switch (fp->N_RB_DL) {
|
||||
|
||||
case 25:
|
||||
@@ -1594,7 +1594,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
((DCI6_1A_10MHz_t *) dci_pdu)->harq_ack_off = rel13->harq_resource_offset;
|
||||
((DCI6_1A_10MHz_t *) dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number;
|
||||
|
||||
LOG_I(PHY,"Frame %d, Subframe %d : Programming Format 6-1A DCI, type %d, hopping %d, narrowband %d, rballoc %x, mcs %d, rep %d, harq_pid %d, ndi %d, rv %d, TPC %d, srs_req %d, harq_ack_off %d, dci_rep r%d => %x\n",
|
||||
LOG_D(PHY,"Frame %d, Subframe %d : Programming Format 6-1A DCI, type %d, hopping %d, narrowband %d, rballoc %x, mcs %d, rep %d, harq_pid %d, ndi %d, rv %d, TPC %d, srs_req %d, harq_ack_off %d, dci_rep r%d => %x\n",
|
||||
frame,subframe,
|
||||
((DCI6_1A_10MHz_t *) dci_pdu)->type,
|
||||
((DCI6_1A_10MHz_t *) dci_pdu)->hopping,
|
||||
@@ -1630,7 +1630,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
break;
|
||||
case 11: // Format 6-1B
|
||||
dci_alloc->format = format6_1B;
|
||||
dlsch0->active = 1;
|
||||
switch (fp->N_RB_DL) {
|
||||
|
||||
case 25:
|
||||
@@ -1670,7 +1669,6 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
}
|
||||
case 12: // Format 6-2
|
||||
dci_alloc->format = format6_2;
|
||||
dlsch0->active = 1;
|
||||
switch (fp->N_RB_DL) {
|
||||
case 25:
|
||||
dci_alloc->dci_length = sizeof_DCI6_2_5MHz_t;
|
||||
@@ -1719,12 +1717,14 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
}
|
||||
AssertFatal (rel13->harq_process < 8, "ERROR: Format 6_1A: harq_pid=%d >= 8\n", rel13->harq_process);
|
||||
|
||||
dlsch0->ue_type = rel13->ce_mode;
|
||||
|
||||
dlsch0_harq = dlsch0->harq_processes[rel13->harq_process];
|
||||
dlsch0_harq->codeword = 0;
|
||||
|
||||
// printf("DCI: Setting subframe_tx for subframe %d\n",subframe);
|
||||
dlsch0->subframe_tx[(subframe + 2) % 10] = 1;
|
||||
LOG_I(PHY,"PDSCH : resource_block_coding %x\n",rel13->resource_block_coding);
|
||||
LOG_D(PHY,"PDSCH : resource_block_coding %x\n",rel13->resource_block_coding);
|
||||
|
||||
conv_eMTC_rballoc (rel13->resource_block_coding,
|
||||
fp->N_RB_DL,
|
||||
@@ -1768,7 +1768,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][1];
|
||||
else if (rel13->tpc == 1) //N1A_PRB=3, get TBS from table using mcs and nb_rb=3
|
||||
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][2];
|
||||
LOG_I(PHY,"TBS = %d(%d)\n",dlsch0_harq->TBS,dlsch0_harq->mcs);
|
||||
LOG_D(PHY,"TBS = %d(%d)\n",dlsch0_harq->TBS,dlsch0_harq->mcs);
|
||||
}
|
||||
dlsch0->active = 1;
|
||||
dlsch0->harq_mask |= (1 << rel13->harq_process);
|
||||
@@ -1776,11 +1776,11 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
|
||||
dlsch0_harq->frame = (subframe >= 8) ? ((frame + 1) & 1023) : frame;
|
||||
dlsch0_harq->subframe = (subframe + 2) % 10;
|
||||
|
||||
LOG_I(PHY,"Setting DLSCH harq_ids[%d] to %d\n",dlsch0_harq->subframe,dlsch0->harq_ids[frame%2][dlsch0_harq->subframe]);
|
||||
dlsch0->harq_ids[frame%2][dlsch0_harq->subframe] = rel13->harq_process;
|
||||
LOG_D(PHY,"Setting DLSCH UEid %d harq_ids[%d] from %d to %d\n",UE_id,dlsch0_harq->subframe,dlsch0->harq_ids[frame%2][dlsch0_harq->subframe],rel13->harq_process);
|
||||
dlsch0->harq_ids[dlsch0_harq->frame%2][dlsch0_harq->subframe] = rel13->harq_process;
|
||||
dlsch0_harq->pdsch_start = rel13->start_symbol;
|
||||
|
||||
LOG_I(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe);
|
||||
LOG_D(PHY,"Setting DLSCH harq %d round %d to active for %d.%d\n",rel13->harq_process,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe);
|
||||
|
||||
dlsch0->rnti = rel13->rnti;
|
||||
|
||||
@@ -2011,6 +2011,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
ulsch->harq_mask |= 1 << harq_pid;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
LOG_D(PHY,"Filling ULSCH : ue_type %d, harq_pid %d\n",ulsch->ue_type,harq_pid);
|
||||
ulsch->ue_type = ulsch_pdu->ulsch_pdu_rel13.ue_type;
|
||||
AssertFatal(harq_pid ==0 || ulsch->ue_type == NOCE, "Harq PID is not zero for BL/CE UE\n");
|
||||
|
||||
@@ -2236,7 +2237,7 @@ void fill_mpdcch_dci0 (PHY_VARS_eNB * eNB, L1_rxtx_proc_t * proc, mDCI_ALLOC_t *
|
||||
((DCI6_0A_10MHz_t *) dci_pdu)->csi_req = cqi_req;
|
||||
((DCI6_0A_10MHz_t *) dci_pdu)->srs_req = rel13->srs_request;
|
||||
((DCI6_0A_10MHz_t *) dci_pdu)->dci_rep = rel13->dci_subframe_repetition_number;
|
||||
LOG_I(PHY,"Frame %d, Subframe %d : Programming Format 6-0A DCI, type %d, hopping %d, narrowband %d, rballoc %x, mcs %d, rep %d, harq_pid %d, ndi %d, rv %d, TPC %d, csi_req %d, srs_req %d, dci_rep r%d => %x\n",
|
||||
LOG_D(PHY,"Frame %d, Subframe %d : Programming Format 6-0A DCI, type %d, hopping %d, narrowband %d, rballoc %x, mcs %d, rep %d, harq_pid %d, ndi %d, rv %d, TPC %d, csi_req %d, srs_req %d, dci_rep r%d => %x\n",
|
||||
proc->frame_tx,proc->subframe_tx,
|
||||
((DCI6_0A_10MHz_t *) dci_pdu)->type,
|
||||
((DCI6_0A_10MHz_t *) dci_pdu)->hopping,
|
||||
|
||||
@@ -84,7 +84,7 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS * frame_parms, mDCI_ALLOC_t * mdci, ui
|
||||
|
||||
// rule for BL/CE UEs from Section 6.8.B2 in 36.211
|
||||
x2 = ((((j0 + j) * Nacc) % 10) << 9) + mdci->dmrs_scrambling_init;
|
||||
LOG_I(PHY,"MPDCCH cinit = %x (mdci->dmrs_scrambling_init = %d), scrambling %d encoded DCI bits\n",
|
||||
LOG_D(PHY,"MPDCCH cinit = %x (mdci->dmrs_scrambling_init = %d), scrambling %d encoded DCI bits\n",
|
||||
x2,mdci->dmrs_scrambling_init,length);
|
||||
for (n = 0; n < length; n++) {
|
||||
if ((n & 0x1f) == 0) {
|
||||
@@ -109,7 +109,7 @@ void init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcchss15tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
LOG_D(PHY, "Inititalizing mpdcchss15tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
|
||||
for (l = 1; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
@@ -117,7 +117,6 @@ void init_mpdcch5ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
if (((l != 5) && (l != 6) && (l != 12) && (l != 13)) || (kmod == 2) || (kmod == 3) || (kmod == 4) || (kmod == 7) || (kmod == 8) || (kmod == 9)) {
|
||||
mpdcch5ss1tab[re] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
re++;
|
||||
printf("l %d, k %d (kmod %d) => re %d\n", l, k, kmod, re);
|
||||
} else if ((kmod == 0) || (kmod == 5) || (kmod == 10)) {
|
||||
mpdcch5ss1tab[re++] = (l * eNB->frame_parms.ofdm_symbol_size) + k;
|
||||
}
|
||||
@@ -139,7 +138,7 @@ void init_mpdcch5ss2tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
int nushift = eNB->frame_parms.Nid_cell % 6;
|
||||
int nushiftp3 = (eNB->frame_parms.Nid_cell+3) % 6;
|
||||
// NOTE : THIS IS FOR TM1 ONLY FOR NOW!!!!!!!
|
||||
LOG_I(PHY, "Inititalizing mpdcch5ss2tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
LOG_D(PHY, "Inititalizing mpdcch5ss2tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 2; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
kmod = k % 12;
|
||||
@@ -168,7 +167,7 @@ void init_mpdcch5ss3tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcch5ss3tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
LOG_D(PHY, "Inititalizing mpdcch5ss3tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 3; l < 14; l++) {
|
||||
for (k = 0; k < 72; k++) {
|
||||
kmod = k % 12;
|
||||
@@ -194,7 +193,7 @@ void init_mpdcch3ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcch3ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
LOG_D(PHY, "Inititalizing mpdcch3ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 1, re = 0; l < 14; l++) {
|
||||
for (k = 0; k < 48; k++) {
|
||||
kmod = k % 12;
|
||||
@@ -218,7 +217,7 @@ void init_mpdcch2ss1tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB * eNB)
|
||||
{
|
||||
int l, k, kmod, re=0;
|
||||
|
||||
LOG_I(PHY, "Inititalizing mpdcch2ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
LOG_D(PHY, "Inititalizing mpdcch2ss1tab for normal prefix, normal prefix, no PSS/SSS/PBCH, even N_RB_DL\n");
|
||||
for (l = 1, re = 0; l < 14; l++) {
|
||||
for (k = 0; k < 24; k++) {
|
||||
kmod = k % 12;
|
||||
@@ -288,7 +287,7 @@ void generate_mdci_top(PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp,
|
||||
int wp[2][4] = {{1,1,1,1},{1,-1,1,-1}};
|
||||
int *w;
|
||||
|
||||
LOG_I(PHY, "generate_mdci_top: num_dci %d\n", mpdcch->num_dci);
|
||||
LOG_D(PHY, "generate_mdci_top: num_dci %d\n", mpdcch->num_dci);
|
||||
|
||||
for (i = 0; i < mpdcch->num_dci; i++) {
|
||||
mdci = &mpdcch->mdci_alloc[i];
|
||||
@@ -320,7 +319,7 @@ void generate_mdci_top(PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp,
|
||||
} else
|
||||
AssertFatal(1 == 0, "Illegal combination start_symbol %d, a_index %d\n", mdci->start_symbol, a_index);
|
||||
|
||||
LOG_I(PHY, "mdci %d, length %d: rnti %x, L %d, prb_pairs %d, ce_mode %d, transmission type %s, i0 %d, ss %d ,coded_bits %d\n",
|
||||
LOG_D(PHY, "mdci %d, length %d: rnti %x, L %d, prb_pairs %d, ce_mode %d, transmission type %s, i0 %d, ss %d ,coded_bits %d\n",
|
||||
i, mdci->dci_length,mdci->rnti,
|
||||
mdci->L, mdci->number_of_prb_pairs,
|
||||
mdci->ce_mode,
|
||||
@@ -422,7 +421,7 @@ void generate_mdci_top(PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp,
|
||||
uint32_t b = ((mdci->dmrs_scrambling_init << 1) + 1) << 16;
|
||||
x2 = a * b;
|
||||
x2 = x2 + 2;
|
||||
LOG_I(PHY, "mpdcch_dmrs cinit %x (a=%d,b=%d,i0=%d,j0=%d)\n", x2,a,b,i0,j0);
|
||||
LOG_D(PHY, "mpdcch_dmrs cinit %x (a=%d,b=%d,i0=%d,j0=%d)\n", x2,a,b,i0,j0);
|
||||
|
||||
// add MPDCCH pilots
|
||||
int reset = 1;
|
||||
|
||||
@@ -507,7 +507,7 @@ int dump_ue_stats(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,char* buffer, int length
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",ue->dlsch_received[0],ue->dlsch_errors[0],ue->dlsch_fer[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH (SI) Total %d, Error %d\n",ue->dlsch_SI_received[0],ue->dlsch_SI_errors[0]);
|
||||
len += sprintf(&buffer[len], "[UE PROC] DLSCH (RA) Total %d, Error %d\n",ue->dlsch_ra_received[0],ue->dlsch_ra_errors[0]);
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
int i=0;
|
||||
|
||||
//len += sprintf(&buffer[len], "[UE PROC] MCH Total %d\n", ue->dlsch_mch_received[0]);
|
||||
|
||||
@@ -719,7 +719,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uint8_t br_flag
|
||||
#endif
|
||||
)
|
||||
@@ -978,7 +978,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
m = (n1_pucch < thres) ? NRB2 : (((n1_pucch-thres)/(12*c/deltaPUCCH_Shift))+NRB2+((deltaPUCCH_Shift*Ncs1_div_deltaPUCCH_Shift)>>3)+rem);
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
printf("[eNB] PUCCH: m %d\n",m);
|
||||
printf("[eNB] PUCCH: m %d, thres %d, NRB2 %d\n",m,thres,NRB2);
|
||||
#endif
|
||||
nsymb = N_UL_symb<<1;
|
||||
|
||||
@@ -989,7 +989,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
//for (j=0,l=0;l<(nsymb-1);l++) {
|
||||
for (j=0,l=0; l<nsymb; l++) {
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (br_flag > 0 ) {
|
||||
if ((m&1) == 0)
|
||||
re_offset = (m*6) + frame_parms->first_carrier_offset;
|
||||
@@ -1227,7 +1227,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
stat_max/=(12); //normalize to energy per symbol and RE
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
printf("[eNB] PUCCH fmt1a/b: stat_max : %d, phase_max : %d\n",stat_max,phase_max);
|
||||
LOG_I(PHY,"[eNB] PUCCH fmt1a/b: stat_max : %d (%d : sigma2 %d), phase_max : %d\n",stat_max,dB_fixed(stat_max),sigma2_dB,phase_max);
|
||||
#endif
|
||||
|
||||
stat_re=0;
|
||||
@@ -1368,7 +1368,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
|
||||
(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe]));
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
LOG_D(PHY,"In pucch.c PUCCH 1a/b: ACK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
|
||||
eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
|
||||
eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
|
||||
@@ -1385,8 +1385,9 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
#if defined(USRP_REC_PLAY)
|
||||
LOG_D(PHY,"PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
#else
|
||||
LOG_D(PHY,"PUCCH 1a/b: subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
#endif
|
||||
LOG_D(PHY,"In pucch.c PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
|
||||
#endif
|
||||
|
||||
*payload = 4; // DTX
|
||||
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
|
||||
((int16_t*)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
|
||||
|
||||
@@ -153,6 +153,8 @@ typedef struct {
|
||||
#else
|
||||
uint8_t active;
|
||||
#endif
|
||||
/// indicator of UE type (0 = LTE, 1,2 = Cat-M)
|
||||
int ue_type;
|
||||
/// HARQ process mask, indicates which processes are currently active
|
||||
uint16_t harq_mask;
|
||||
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
|
||||
|
||||
@@ -553,7 +553,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
uint8_t *payload,
|
||||
int frame,
|
||||
uint8_t subframe,
|
||||
uint8_t pucch1_thres);
|
||||
uint8_t pucch1_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,int br_flag
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
/*!
|
||||
|
||||
@@ -738,7 +738,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
int subframe = proc->subframe_rx;
|
||||
LTE_UL_eNB_HARQ_t *ulsch_harq;
|
||||
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
LOG_D(PHY,"ue_type %d\n",ulsch->ue_type);
|
||||
if (ulsch->ue_type>0) harq_pid = 0;
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1127,7 +1127,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
|
||||
int16_t *llrp;
|
||||
int subframe = proc->subframe_rx;
|
||||
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ulsch[UE_id]->ue_type > 0) harq_pid =0;
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1361,7 +1361,7 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
@param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/
|
||||
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB);
|
||||
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void init_mpdcch(PHY_VARS_eNB *eNB);
|
||||
#endif
|
||||
|
||||
|
||||
+17
-2
@@ -967,6 +967,22 @@ typedef struct PHY_VARS_eNB_s {
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
|
||||
// PRACH energy detection parameters
|
||||
/// Detection threshold for LTE PRACH
|
||||
int prach_DTX_threshold;
|
||||
/// Detection threshold for LTE-M PRACH per CE-level
|
||||
int prach_DTX_threshold_emtc[4];
|
||||
/// counter to average prach energh over first 100 prach opportunities
|
||||
int prach_energy_counter;
|
||||
// PUCCH1 energy detection parameters
|
||||
int pucch1_DTX_threshold;
|
||||
// PUCCH1 energy detection parameters for eMTC per CE-level
|
||||
int pucch1_DTX_threshold_emtc[4];
|
||||
// PUCCH1a/b energy detection parameters
|
||||
int pucch1ab_DTX_threshold;
|
||||
// PUCCH1a/b energy detection parameters for eMTC per CE-level
|
||||
int pucch1ab_DTX_threshold_emtc[4];
|
||||
|
||||
uint32_t X_u[64][839];
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint32_t X_u_br[4][64][839];
|
||||
@@ -1003,8 +1019,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
|
||||
/// if ==0 enables phy only test mode
|
||||
int mac_enabled;
|
||||
/// counter to average prach energh over first 100 prach opportunities
|
||||
int prach_energy_counter;
|
||||
|
||||
|
||||
// PDSCH Varaibles
|
||||
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
@@ -397,10 +397,12 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
#else
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
if (rel13->ue_type>0)
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
else
|
||||
#endif
|
||||
dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols;
|
||||
|
||||
if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
|
||||
AssertFatal(sdu!=NULL,"NFAPI: frame %d, subframe %d: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d\n",
|
||||
proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
|
||||
@@ -704,9 +706,12 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
|
||||
// check if we have received a dci for this ue and ulsch descriptor is configured
|
||||
|
||||
if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) {
|
||||
//if (UE_id == find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE)<0)
|
||||
//for (int i=0;i<16;i++) if (eNB->ulsch[i]->harq_mask>0) LOG_I(PHY,"rnti %x, mask %x\n",eNB->ulsch[i]->rnti,eNB->ulsch[i]->harq_mask >0);
|
||||
AssertFatal((UE_id = find_ulsch(ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE))>=0,
|
||||
"No existing UE ULSCH for rnti %x\n",rel8->rnti);
|
||||
LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version);
|
||||
LOG_D(PHY,"Applying UL config for UE %d, rnti %x for frame %d, subframe %d, modulation %d, rvidx %d, first_rb %d, nb_rb %d\n", UE_id,rel8->rnti,frame,subframe,rel8->modulation_type,rel8->redundancy_version,
|
||||
rel8->resource_block_start,rel8->number_of_resource_blocks);
|
||||
|
||||
fill_ulsch(eNB,UE_id,&ul_config_pdu->ulsch_pdu,frame,subframe);
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
|
||||
|
||||
LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n",
|
||||
if (dlsch->rnti!=0xffff) LOG_D(PHY,"Generating DLSCH/PDSCH pdu:%p pdsch_start:%d frame:%d subframe:%d nb_rb:%d rb_alloc:%d Qm:%d Nl:%d round:%d\n",
|
||||
dlsch_harq->pdu,dlsch_harq->pdsch_start,frame,subframe,dlsch_harq->nb_rb,dlsch_harq->rb_alloc[0],dlsch_harq->Qm,dlsch_harq->Nl,dlsch_harq->round);
|
||||
// 36-212
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1) { // monolthic OR PNF - do not need turbo encoding on VNF
|
||||
@@ -534,7 +534,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
num_mdci = eNB->mpdcch_vars[subframe &1].num_dci;
|
||||
if (num_mdci > 0) {
|
||||
LOG_I (PHY, "[eNB %" PRIu8 "] Frame %d, subframe %d: Calling generate_mdci_top (mpdcch) (num_dci %" PRIu8 ")\n", eNB->Mod_id, frame, subframe, num_mdci);
|
||||
LOG_D (PHY, "[eNB %" PRIu8 "] Frame %d, subframe %d: Calling generate_mdci_top (mpdcch) (num_dci %" PRIu8 ")\n", eNB->Mod_id, frame, subframe, num_mdci);
|
||||
|
||||
generate_mdci_top (eNB, frame, subframe, AMP, eNB->common_vars.txdataF);
|
||||
|
||||
@@ -566,12 +566,22 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
|
||||
if (harq_pid>=8)
|
||||
{
|
||||
LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (harq_pid>=8) {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (dlsch0->ue_type==0)
|
||||
#endif
|
||||
LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti,
|
||||
dlsch0->harq_ids[frame%2][0],
|
||||
dlsch0->harq_ids[frame%2][1],
|
||||
dlsch0->harq_ids[frame%2][2],
|
||||
dlsch0->harq_ids[frame%2][3],
|
||||
dlsch0->harq_ids[frame%2][4],
|
||||
dlsch0->harq_ids[frame%2][5],
|
||||
dlsch0->harq_ids[frame%2][6],
|
||||
dlsch0->harq_ids[frame%2][7]);
|
||||
} else
|
||||
{
|
||||
// generate pdsch
|
||||
|
||||
pdsch_procedures(eNB,
|
||||
@@ -581,7 +591,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
dlsch1,
|
||||
&eNB->UE_stats[(uint32_t)UE_id],
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -725,109 +735,77 @@ void uci_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc)
|
||||
switch (uci->type) {
|
||||
case SR:
|
||||
case HARQ_SR:
|
||||
|
||||
metric_SR = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
&SR_payload,
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n",
|
||||
eNB->Mod_id,
|
||||
uci->rnti,
|
||||
frame,
|
||||
subframe,
|
||||
SR_payload,
|
||||
uci->type,
|
||||
uci->n_pucch_1_0_sr[0]);
|
||||
if (uci->type == SR) {
|
||||
if (SR_payload == 1) {
|
||||
fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
case HARQ:
|
||||
if (fp->frame_type == FDD) {
|
||||
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
|
||||
frame,subframe,i,
|
||||
uci->pucch_fmt,uci->type,
|
||||
uci->frame,uci->subframe,uci->n_pucch_1[0][0],
|
||||
SR_payload);
|
||||
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
|
||||
|
||||
/* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index, otherwise send it up to MAC */
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
/* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */
|
||||
SR_payload = 1;
|
||||
|
||||
metric[0]=rx_pucch(eNB,
|
||||
{
|
||||
int pucch1_thres = (uci->ue_type == 0) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
|
||||
metric_SR = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
&SR_payload,
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
}
|
||||
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n",
|
||||
pucch1_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n",
|
||||
eNB->Mod_id,
|
||||
uci->rnti,
|
||||
frame,subframe,
|
||||
pucch_b0b1[0][0],metric[0]);
|
||||
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff);
|
||||
|
||||
frame,
|
||||
subframe,
|
||||
SR_payload,
|
||||
uci->type,
|
||||
uci->n_pucch_1_0_sr[0]);
|
||||
if (uci->type == SR) {
|
||||
if (SR_payload == 1) {
|
||||
fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // frame_type == TDD
|
||||
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
|
||||
frame,subframe,i,
|
||||
uci->pucch_fmt,uci->type,
|
||||
uci->frame,uci->subframe,uci->n_pucch_1[0][0],
|
||||
SR_payload);
|
||||
#if 1
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
SR_payload = 1;
|
||||
case HARQ:
|
||||
{
|
||||
int pucch1ab_thres = (uci->ue_type == 0) ? eNB->pucch1ab_DTX_threshold : eNB->pucch1ab_DTX_threshold_emtc[0];
|
||||
if (fp->frame_type == FDD) {
|
||||
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
|
||||
frame,subframe,i,
|
||||
uci->pucch_fmt,uci->type,
|
||||
uci->frame,uci->subframe,uci->n_pucch_1[0][0],
|
||||
SR_payload);
|
||||
|
||||
metric[0] = rx_pucch(eNB,
|
||||
pucch_format1b,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
//dump_ulsch(eNB,frame,subframe,0,0); exit(-1);
|
||||
|
||||
|
||||
/* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index, otherwise send it up to MAC */
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
/* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */
|
||||
SR_payload = 1;
|
||||
|
||||
metric[0]=rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
@@ -835,365 +813,427 @@ void uci_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc)
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n",
|
||||
eNB->Mod_id,
|
||||
uci->rnti,
|
||||
frame,subframe,
|
||||
pucch_b0b1[0][0],metric[0]);
|
||||
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,pucch_b0b1[0],0,0xffff);
|
||||
|
||||
}
|
||||
else { // frame_type == TDD
|
||||
LOG_D(PHY,"Frame %d Subframe %d Demodulating PUCCH (UCI %d) for ACK/NAK (uci->pucch_fmt %d,uci->type %d.uci->frame %d, uci->subframe %d): n1_pucch0 %d SR_payload %d\n",
|
||||
frame,subframe,i,
|
||||
uci->pucch_fmt,uci->type,
|
||||
uci->frame,uci->subframe,uci->n_pucch_1[0][0],
|
||||
SR_payload);
|
||||
#if 1
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
SR_payload = 1;
|
||||
metric[0] = rx_pucch(eNB,
|
||||
pucch_format1b,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
|
||||
}
|
||||
#else
|
||||
// if SR was detected, use the n1_pucch from SR
|
||||
if (SR_payload==1) {
|
||||
// if SR was detected, use the n1_pucch from SR
|
||||
if (SR_payload==1) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti, frame, subframe, n1_pucch0, n1_pucch1, n1_pucch2, n1_pucch3, format);
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti, frame, subframe, n1_pucch0, n1_pucch1, n1_pucch2, n1_pucch3, format);
|
||||
#endif
|
||||
|
||||
metric[0] = rx_pucch (eNB, pucch_format1b, i, uci->n_pucch_1_0_sr[0], 0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0], frame, subframe, PUCCH1a_THRES
|
||||
|
||||
metric[0] = rx_pucch (eNB, pucch_format1b, i, uci->n_pucch_1_0_sr[0], 0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0], frame, subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
} else { //using assigned pucch resources
|
||||
);
|
||||
} else { //using assigned pucch resources
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK M=%d (%d,%d,%d,%d) format %d\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti,
|
||||
frame, subframe, uci->num_pucch_resources, uci->n_pucch_1[res][0], uci->n_pucch_1[res][1], uci->n_pucch_1[res][2], uci->n_pucch_1[res][3], uci->pucch_fmt);
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK M=%d (%d,%d,%d,%d) format %d\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti,
|
||||
frame, subframe, uci->num_pucch_resources, uci->n_pucch_1[res][0], uci->n_pucch_1[res][1], uci->n_pucch_1[res][2], uci->n_pucch_1[res][3], uci->pucch_fmt);
|
||||
#endif
|
||||
for (res = 0; res < uci->num_pucch_resources; res++)
|
||||
metric[res] = rx_pucch (eNB, uci->pucch_fmt, i, uci->n_pucch_1[res][0], 0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[res], frame, subframe, PUCCH1a_THRES
|
||||
for (res = 0; res < uci->num_pucch_resources; res++)
|
||||
metric[res] = rx_pucch (eNB, uci->pucch_fmt, i, uci->n_pucch_1[res][0], 0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[res], frame, subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
for (res=0;res<uci->num_pucch_resources;res++)
|
||||
metric[res] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[res][0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[res],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES,
|
||||
);
|
||||
for (res=0;res<uci->num_pucch_resources;res++)
|
||||
metric[res] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[res][0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[res],
|
||||
frame,
|
||||
subframe,
|
||||
pucch1ab_thres
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,uci->ue_type
|
||||
,uci->ue_type
|
||||
#endif
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"RNTI %x type %d SR_payload %d Frame %d Subframe %d pucch_b0b1[0][0] %d pucch_b0b1[0][1] %d pucch_b0b1[1][0] %d pucch_b0b1[1][1] %d \n",
|
||||
uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]);
|
||||
LOG_D(PHY,"RNTI %x type %d SR_payload %d Frame %d Subframe %d pucch_b0b1[0][0] %d pucch_b0b1[0][1] %d pucch_b0b1[1][0] %d pucch_b0b1[1][1] %d \n",
|
||||
uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]);
|
||||
#endif
|
||||
#endif
|
||||
if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213
|
||||
if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1) { // 1/4/7 ACKs
|
||||
harq_ack[0] = 1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1) { // 2/5/8 ACKs
|
||||
harq_ack[0] = 2;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1) { // 3/6/9 ACKs
|
||||
harq_ack[0] = 3;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1) { // 0 ACKs, or at least one DL assignment missed
|
||||
harq_ack[0] = 0;
|
||||
}
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode
|
||||
}
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
|
||||
if (pucch_b0b1[0][0] == 4 ||
|
||||
pucch_b0b1[1][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
}
|
||||
else {
|
||||
if (metric[1]>metric[0]) {
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1){
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
}
|
||||
if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213
|
||||
if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1) { // 1/4/7 ACKs
|
||||
harq_ack[0] = 1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1) { // 2/5/8 ACKs
|
||||
harq_ack[0] = 2;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1) { // 3/6/9 ACKs
|
||||
harq_ack[0] = 3;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1) { // 0 ACKs, or at least one DL assignment missed
|
||||
harq_ack[0] = 0;
|
||||
}
|
||||
uci->stat = metric[0];
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,2,0xffff); // special_bundling mode
|
||||
}
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==2)){ // multiplexing + no SR, implement Table 10.1.3-5 (Rel14) for multiplexing with M=2
|
||||
if (pucch_b0b1[0][0] == 4 ||
|
||||
pucch_b0b1[1][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
}
|
||||
else {
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
if (metric[1]>metric[0]) {
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1){
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
}
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
uci->stat = max(metric[0],metric[1]);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} //else if ((uci->tdd_bundling == 0) && (res==2))
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3
|
||||
|
||||
if (harq_ack[0] == 4 ||
|
||||
harq_ack[1] == 4 ||
|
||||
harq_ack[2] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
max_metric = 0;
|
||||
}
|
||||
else {
|
||||
uci->stat = max(metric[0],metric[1]);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} //else if ((uci->tdd_bundling == 0) && (res==2))
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==3)){ // multiplexing + no SR, implement Table 10.1.3-6 (Rel14) for multiplexing with M=3
|
||||
|
||||
max_metric = max(metric[0],max(metric[1],metric[2]));
|
||||
|
||||
if (metric[0]==max_metric) {
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
}
|
||||
} // if (metric[0]==max_metric) {
|
||||
else if (metric[1]==max_metric) {
|
||||
if (harq_ack[0] == 4 ||
|
||||
harq_ack[1] == 4 ||
|
||||
harq_ack[2] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
max_metric = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
max_metric = max(metric[0],max(metric[1],metric[2]));
|
||||
|
||||
if (metric[0]==max_metric) {
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
}
|
||||
} // if (metric[0]==max_metric) {
|
||||
else if (metric[1]==max_metric) {
|
||||
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
}
|
||||
} // if (metric[1]==max_metric) {
|
||||
else {
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x7;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x5;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x6;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x4;
|
||||
}
|
||||
}
|
||||
} // if (metric[1]==max_metric) {
|
||||
else {
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x7;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x5;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x6;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x4;
|
||||
uci->stat = max_metric;
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
}
|
||||
} //else if ((uci->tdd_bundling == 0) && (res==3))
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4
|
||||
if (pucch_b0b1[0][0] == 4 ||
|
||||
pucch_b0b1[1][0] == 4 ||
|
||||
pucch_b0b1[2][0] == 4 ||
|
||||
pucch_b0b1[3][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
max_metric = 0;
|
||||
} else {
|
||||
|
||||
max_metric = max(metric[0],max(metric[1],max(metric[2],metric[3])));
|
||||
|
||||
if (metric[0]==max_metric) {
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
harq_ack[3] = 4; // DTX
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x9;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
}
|
||||
|
||||
}
|
||||
else if (metric[1]==max_metric) {
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xF;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xE;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
}
|
||||
else if (metric[2]==max_metric) {
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x7;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x5;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 4; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 4; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x6;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 4; // NACK/DTX
|
||||
harq_ack[1] = 4; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 4; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x4;
|
||||
}
|
||||
}
|
||||
else { // max_metric[3]=max_metric
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xD;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xA;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xC;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x8;
|
||||
}
|
||||
}
|
||||
}
|
||||
uci->stat = max_metric;
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} // else if ((uci->tdd_bundling == 0) && (res==4))
|
||||
else { // bundling
|
||||
harq_ack[0] = pucch_b0b1[0][0];
|
||||
harq_ack[1] = pucch_b0b1[0][1];
|
||||
uci->stat = metric[0];
|
||||
LOG_D(PHY,"bundling: (%d,%d), metric %d\n",harq_ack[0],harq_ack[1],uci->stat);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode
|
||||
}
|
||||
} //else if ((uci->tdd_bundling == 0) && (res==3))
|
||||
else if ((uci->tdd_bundling == 0) && (uci->num_pucch_resources==4)){ // multiplexing + no SR, implement Table 10.1.3-7 (Rel14) for multiplexing with M=4
|
||||
if (pucch_b0b1[0][0] == 4 ||
|
||||
pucch_b0b1[1][0] == 4 ||
|
||||
pucch_b0b1[2][0] == 4 ||
|
||||
pucch_b0b1[3][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
max_metric = 0;
|
||||
} else {
|
||||
|
||||
max_metric = max(metric[0],max(metric[1],max(metric[2],metric[3])));
|
||||
|
||||
if (metric[0]==max_metric) {
|
||||
if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 4; // DTX
|
||||
harq_ack[2] = 4; // DTX
|
||||
harq_ack[3] = 4; // DTX
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x9;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x1;
|
||||
}
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1){
|
||||
harq_ack[0] = 2; // NACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
}
|
||||
|
||||
}
|
||||
else if (metric[1]==max_metric) {
|
||||
if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xF;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xE;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x2;
|
||||
}
|
||||
}
|
||||
else if (metric[2]==max_metric) {
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x7;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 6; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x5;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 4; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 4; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x6;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 4; // NACK/DTX
|
||||
harq_ack[1] = 4; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 4; // NACK/DTX
|
||||
tdd_multiplexing_mask = 0x4;
|
||||
}
|
||||
}
|
||||
else { // max_metric[3]=max_metric
|
||||
if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] == 1){
|
||||
harq_ack[0] = 1; // ACK
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xD;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] == 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 1; // ACK
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xA;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] == 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 1; // ACK
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0xC;
|
||||
}
|
||||
else if (pucch_b0b1[2][0] != 1 && pucch_b0b1[2][1] != 1 ) {
|
||||
harq_ack[0] = 6; // NACK/DTX
|
||||
harq_ack[1] = 6; // NACK/DTX
|
||||
harq_ack[2] = 6; // NACK/DTX
|
||||
harq_ack[3] = 1; // ACK
|
||||
tdd_multiplexing_mask = 0x8;
|
||||
}
|
||||
}
|
||||
}
|
||||
uci->stat = max_metric;
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,1,tdd_multiplexing_mask); // multiplexing mode
|
||||
} // else if ((uci->tdd_bundling == 0) && (res==4))
|
||||
else { // bundling
|
||||
harq_ack[0] = pucch_b0b1[0][0];
|
||||
harq_ack[1] = pucch_b0b1[0][1];
|
||||
uci->stat = metric[0];
|
||||
LOG_D(PHY,"bundling: (%d,%d), metric %d\n",harq_ack[0],harq_ack[1],uci->stat);
|
||||
fill_uci_harq_indication(eNB,uci,frame,subframe,harq_ack,0,0xffff); // special_bundling mode
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, (%d,%d)\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
|
||||
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, (%d,%d)\n", eNB->Mod_id,
|
||||
eNB->dlsch[UE_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal (1 == 0, "Unsupported UCI type %d\n", uci->type);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal (1 == 0, "Unsupported UCI type %d\n", uci->type);
|
||||
break;
|
||||
}
|
||||
|
||||
if (SR_payload == 1) {
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n", eNB->Mod_id, uci->rnti, frame, subframe);
|
||||
|
||||
if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
eNB->first_sr[i] = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->round = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->status = SCH_IDLE;
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d First SR\n", eNB->Mod_id, eNB->ulsch[i]->rnti, frame, subframe);
|
||||
if (SR_payload == 1) {
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n", eNB->Mod_id, uci->rnti, frame, subframe);
|
||||
|
||||
if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
eNB->first_sr[i] = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->round = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->status = SCH_IDLE;
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d First SR\n", eNB->Mod_id, eNB->ulsch[i]->rnti, frame, subframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1212,12 +1252,12 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc)
|
||||
const int subframe = proc->subframe_rx;
|
||||
const int frame = proc->frame_rx;
|
||||
|
||||
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
|
||||
uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
|
||||
|
||||
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
ulsch = eNB->ulsch[i];
|
||||
if (ulsch->ue_type > 0) harq_pid = 0;
|
||||
if (ulsch->ue_type > 0) harq_pid = 0; else harq_pid=harq_pid0;
|
||||
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
}
|
||||
}
|
||||
|
||||
// run PRACH detection for CE-level 0 only for now when br_flag is set
|
||||
rx_prach(eNB,
|
||||
eNB->RU_list[0],
|
||||
&max_preamble[0],
|
||||
@@ -114,8 +115,8 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
#endif
|
||||
);
|
||||
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,subframe,
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : BR %d Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,subframe,br_flag,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0],
|
||||
@@ -141,7 +142,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
*/
|
||||
|
||||
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
|
||||
if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + 200)) {
|
||||
if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + eNB->prach_DTX_threshold_emtc[0])) {
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
|
||||
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind]; //
|
||||
@@ -168,7 +169,7 @@ void prach_procedures(PHY_VARS_eNB *eNB
|
||||
|
||||
{
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+100)) {
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+eNB->prach_DTX_threshold)) {
|
||||
|
||||
LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
eNB->Mod_id,
|
||||
|
||||
@@ -236,9 +236,7 @@ typedef struct protocol_ctxt_s {
|
||||
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
|
||||
eNB_index_t eNB_index; /*!< \brief valid for UE indicating the index of connected eNB(s) */
|
||||
boolean_t configured; /*!< \brief flag indicating whether the instance is configured or not */
|
||||
#ifdef Rel14
|
||||
boolean_t brOption;
|
||||
#endif
|
||||
} protocol_ctxt_t;
|
||||
// warning time hardcoded
|
||||
#define PROTOCOL_CTXT_TIME_MILLI_SECONDS(CtXt_h) ((CtXt_h)->frame*10+(CtXt_h)->subframe)
|
||||
|
||||
@@ -148,7 +148,7 @@ typedef struct RadioResourceConfig_s {
|
||||
long ue_TimersAndConstants_n311;
|
||||
long ue_TransmissionMode;
|
||||
long ue_multiple_max;
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//SIB2 BR Options
|
||||
long* preambleTransMax_CE_r13;
|
||||
BOOLEAN_t prach_ConfigCommon_v1310;
|
||||
|
||||
@@ -32,6 +32,7 @@ MESSAGE_DEF(X2AP_SETUP_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgT
|
||||
|
||||
/* eNB application layer -> X2AP messages */
|
||||
MESSAGE_DEF(X2AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, x2ap_register_enb_req_t , x2ap_register_enb_req)
|
||||
MESSAGE_DEF(X2AP_SUBFRAME_PROCESS , MESSAGE_PRIORITY_MED, x2ap_subframe_process_t , x2ap_subframe_process)
|
||||
|
||||
/* X2AP -> eNB application layer messages */
|
||||
MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_register_enb_cnf_t , x2ap_register_enb_cnf)
|
||||
@@ -40,6 +41,7 @@ MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_der
|
||||
/* handover messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_HANDOVER_REQ , MESSAGE_PRIORITY_MED, x2ap_handover_req_t , x2ap_handover_req)
|
||||
MESSAGE_DEF(X2AP_HANDOVER_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_handover_req_ack_t , x2ap_handover_req_ack)
|
||||
MESSAGE_DEF(X2AP_HANDOVER_CANCEL , MESSAGE_PRIORITY_MED, x2ap_handover_cancel_t , x2ap_handover_cancel)
|
||||
|
||||
/* handover messages X2AP <-> S1AP */
|
||||
MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_context_release_t , x2ap_ue_context_release)
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
|
||||
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
|
||||
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
|
||||
|
||||
|
||||
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
|
||||
@@ -48,6 +49,16 @@ typedef struct x2ap_ue_context_release_s {
|
||||
int source_assoc_id;
|
||||
} x2ap_ue_context_release_t;
|
||||
|
||||
typedef enum {
|
||||
X2AP_T_RELOC_PREP_TIMEOUT,
|
||||
X2AP_TX2_RELOC_OVERALL_TIMEOUT
|
||||
} x2ap_handover_cancel_cause_t;
|
||||
|
||||
typedef struct x2ap_handover_cancel_s {
|
||||
int rnti;
|
||||
x2ap_handover_cancel_cause_t cause;
|
||||
} x2ap_handover_cancel_t;
|
||||
|
||||
typedef struct x2ap_register_enb_req_s {
|
||||
/* Unique eNB_id to identify the eNB within EPC.
|
||||
* For macro eNB ids this field should be 20 bits long.
|
||||
@@ -105,8 +116,16 @@ typedef struct x2ap_register_enb_req_s {
|
||||
|
||||
/* eNB port for X2C*/
|
||||
uint32_t enb_port_for_X2C;
|
||||
|
||||
/* timers (unit: millisecond) */
|
||||
int t_reloc_prep;
|
||||
int tx2_reloc_overall;
|
||||
} x2ap_register_enb_req_t;
|
||||
|
||||
typedef struct x2ap_subframe_process_s {
|
||||
/* nothing, we simply use the module ID in the header */
|
||||
} x2ap_subframe_process_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// X2AP -> eNB application layer messages
|
||||
typedef struct x2ap_register_enb_cnf_s {
|
||||
|
||||
@@ -44,7 +44,21 @@
|
||||
#define CONFIG_STRING_L1_LOCAL_N_PORTD "local_n_portd"
|
||||
#define CONFIG_STRING_L1_REMOTE_N_PORTD "remote_n_portd"
|
||||
#define CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE "tr_n_preference"
|
||||
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_THRESHOLD "prach_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1_DTX_THRESHOLD "pucch1_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1AB_DTX_THRESHOLD "pucch1ab_dtx_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_EMTC0_THRESHOLD "prach_dtx_emtc0_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC0_THRESHOLD "pucch1_dtx_emtc0_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC0_THRESHOLD "pucch1ab_dtx_emtc0_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_EMTC1_THRESHOLD "prach_dtx_emtc1_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC1_THRESHOLD "pucch1_dtx_emtc1_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC1_THRESHOLD "pucch1ab_dtx_emtc1_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_EMTC2_THRESHOLD "prach_dtx_emtc2_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC2_THRESHOLD "pucch1_dtx_emtc2_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC2_THRESHOLD "pucch1ab_dtx_emtc2_threshold"
|
||||
#define CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD "prach_dtx_emtc3_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD "pucch1_dtx_emtc3_threshold"
|
||||
#define CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD "pucch1ab_dtx_emtc3_threshold"
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* L1 configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -59,7 +73,22 @@
|
||||
{CONFIG_STRING_L1_REMOTE_N_PORTC, NULL, 0, uptr:NULL, defintval:50030, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_LOCAL_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_L1_REMOTE_N_PORTD, NULL, 0, uptr:NULL, defintval:50031, TYPE_UINT, 0}, \
|
||||
}
|
||||
{CONFIG_STRING_L1_PRACH_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:100, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1AB_DTX_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC0_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC1_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC2_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PRACH_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_L1_PUCCH1AB_DTX_EMTC3_THRESHOLD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0} \
|
||||
}
|
||||
#define L1_CC_IDX 0
|
||||
#define L1_TRANSPORT_N_PREFERENCE_IDX 1
|
||||
#define L1_LOCAL_N_IF_NAME_IDX 2
|
||||
@@ -69,5 +98,19 @@
|
||||
#define L1_REMOTE_N_PORTC_IDX 6
|
||||
#define L1_LOCAL_N_PORTD_IDX 7
|
||||
#define L1_REMOTE_N_PORTD_IDX 8
|
||||
|
||||
#define L1_PRACH_DTX_THRESHOLD_IDX 9
|
||||
#define L1_PUCCH1_DTX_THRESHOLD_IDX 10
|
||||
#define L1_PUCCH1AB_DTX_THRESHOLD_IDX 11
|
||||
#define L1_PRACH_DTX_EMTC0_THRESHOLD_IDX 12
|
||||
#define L1_PUCCH1_DTX_EMTC0_THRESHOLD_IDX 13
|
||||
#define L1_PUCCH1AB_DTX_EMTC0_THRESHOLD_IDX 14
|
||||
#define L1_PRACH_DTX_EMTC1_THRESHOLD_IDX 15
|
||||
#define L1_PUCCH1_DTX_EMTC1_THRESHOLD_IDX 16
|
||||
#define L1_PUCCH1AB_DTX_EMTC1_THRESHOLD_IDX 17
|
||||
#define L1_PRACH_DTX_EMTC2_THRESHOLD_IDX 18
|
||||
#define L1_PUCCH1_DTX_EMTC2_THRESHOLD_IDX 19
|
||||
#define L1_PUCCH1AB_DTX_EMTC2_THRESHOLD_IDX 20
|
||||
#define L1_PRACH_DTX_EMTC3_THRESHOLD_IDX 21
|
||||
#define L1_PUCCH1_DTX_EMTC3_THRESHOLD_IDX 22
|
||||
#define L1_PUCCH1AB_DTX_EMTC3_THRESHOLD_IDX 23
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -151,8 +151,8 @@ void *eNB_app_task(void *args_p) {
|
||||
uint32_t register_enb_pending=0;
|
||||
uint32_t registered_enb;
|
||||
long enb_register_retry_timer_id;
|
||||
uint32_t x2_register_enb_pending;
|
||||
uint32_t x2_registered_enb;
|
||||
uint32_t x2_register_enb_pending = 0;
|
||||
uint32_t x2_registered_enb = 0;
|
||||
long x2_enb_register_retry_timer_id;
|
||||
uint32_t enb_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
@@ -188,9 +188,11 @@ void *eNB_app_task(void *args_p) {
|
||||
register_enb_pending = eNB_app_register (enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
}
|
||||
|
||||
/* Try to register each eNB with each other */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
if (is_x2ap_enabled()) {
|
||||
/* Try to register each eNB with each other */
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
|
||||
do {
|
||||
// Wait for a message
|
||||
|
||||
@@ -236,6 +236,16 @@ void RCconfig_L1(void) {
|
||||
RC.eNB[j][0]->eth_params_n .remote_portd);
|
||||
} else { // other midhaul
|
||||
}
|
||||
// PRACH/PUCCH parameters
|
||||
|
||||
RC.eNB[j][0]->prach_DTX_threshold = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD_IDX].iptr);
|
||||
RC.eNB[j][0]->pucch1_DTX_threshold = *(L1_ParamList.paramarray[j][L1_PUCCH1_DTX_THRESHOLD_IDX].iptr);
|
||||
RC.eNB[j][0]->pucch1ab_DTX_threshold = *(L1_ParamList.paramarray[j][L1_PUCCH1AB_DTX_THRESHOLD_IDX].iptr);
|
||||
for (int ce_level=0;ce_level<4;ce_level++) {
|
||||
RC.eNB[j][0]->prach_DTX_threshold_emtc[ce_level] = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_EMTC0_THRESHOLD_IDX+ce_level].iptr);
|
||||
RC.eNB[j][0]->pucch1_DTX_threshold_emtc[ce_level] = *(L1_ParamList.paramarray[j][L1_PUCCH1_DTX_EMTC0_THRESHOLD_IDX+ce_level].iptr);
|
||||
RC.eNB[j][0]->pucch1ab_DTX_threshold_emtc[ce_level] = *(L1_ParamList.paramarray[j][L1_PUCCH1AB_DTX_EMTC0_THRESHOLD_IDX+ce_level].iptr);
|
||||
}
|
||||
}// j=0..num_inst
|
||||
|
||||
LOG_I(ENB_APP,"Initializing northbound interface for L1\n");
|
||||
@@ -2053,6 +2063,28 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
}
|
||||
}
|
||||
|
||||
// timers
|
||||
{
|
||||
int t_reloc_prep = 0;
|
||||
int tx2_reloc_overall = 0;
|
||||
|
||||
paramdef_t p[] = {
|
||||
{ "t_reloc_prep", "t_reloc_prep", 0, iptr:&t_reloc_prep, defintval:0, TYPE_INT, 0 },
|
||||
{ "tx2_reloc_overall", "tx2_reloc_overall", 0, iptr:&tx2_reloc_overall, defintval:0, TYPE_INT, 0 }
|
||||
};
|
||||
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), aprefix);
|
||||
|
||||
if (t_reloc_prep <= 0 || t_reloc_prep > 10000 ||
|
||||
tx2_reloc_overall <= 0 || tx2_reloc_overall > 20000) {
|
||||
LOG_E(X2AP, "timers in configuration file have wrong values. We must have [0 < t_reloc_prep <= 10000] and [0 < tx2_reloc_overall <= 20000]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_reloc_prep = t_reloc_prep;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).tx2_reloc_overall = tx2_reloc_overall;
|
||||
}
|
||||
|
||||
// SCTP SETTING
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS;
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
#define ENB_CONFIG_STRING_LAST_PREAMBLE_R13 "lastPreamble_r13"
|
||||
#define ENB_CONFIG_STRING_RA_RESPONSE_WINDOW_SIZE_R13 "ra_ResponseWindowSize_r13"
|
||||
#define ENB_CONFIG_STRING_MAC_CONTENTION_RESOLUTION_TIMER_R13 "mac_ContentionResolutionTimer_r13"
|
||||
#define ENB_CONFIG_STRING_RAR_HOPPING_CONFIG_R13 "rar_HoppingConfig_r13 "
|
||||
#define ENB_CONFIG_STRING_RAR_HOPPING_CONFIG_R13 "rar_HoppingConfig_r13"
|
||||
#define ENB_CONFIG_STRING_RACH_CE_LEVELINFOLIST_R13 "rach_CE_LevelInfoList_r13"
|
||||
#define ENB_CONFIG_STRING_PRACH_CONFIG_INDEX_BR "prach_config_index_br"
|
||||
#define ENB_CONFIG_STRING_PRACH_FREQ_OFFSET_BR "prach_freq_offset_br"
|
||||
|
||||
+12
-12
@@ -61,13 +61,13 @@
|
||||
#include "RACH-ConfigCommon.h"
|
||||
#include "MeasObjectToAddModList.h"
|
||||
#include "MobilityControlInfo.h"
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
#include "MBSFN-AreaInfoList-r9.h"
|
||||
#include "MBSFN-SubframeConfigList.h"
|
||||
#include "PMCH-InfoList-r9.h"
|
||||
#include "SCellToAddMod-r10.h"
|
||||
#endif
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
#include "SystemInformationBlockType1-v1310-IEs.h"
|
||||
#endif
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
#define SCH_PAYLOAD_SIZE_MAX 4096
|
||||
/// Logical channel ids from 36-311 (Note BCCH is not specified in 36-311, uses the same as first DRB)
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
// Mask for identifying subframe for MBMS
|
||||
#define MBSFN_TDD_SF3 0x80// for TDD
|
||||
@@ -283,7 +283,7 @@ typedef struct {
|
||||
uint8_t payload[PCCH_PAYLOAD_SIZE_MAX] ;
|
||||
} __attribute__((__packed__))PCCH_PDU;
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/*! \brief MCCH payload */
|
||||
typedef struct {
|
||||
uint8_t payload[MCCH_PAYLOAD_SIZE_MAX] ;
|
||||
@@ -340,7 +340,7 @@ typedef struct {
|
||||
/*!\brief LCID of padding LCID for DLSCH */
|
||||
#define SHORT_PADDING 31
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
// MCH LCHAN IDs (table6.2.1-4 TS36.321)
|
||||
/*!\brief LCID of MCCH for DL */
|
||||
#define MCCH_LCHANID 0
|
||||
@@ -759,7 +759,7 @@ typedef struct {
|
||||
eNB_UE_estimated_distances distance;
|
||||
#endif
|
||||
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint8_t rach_resource_type;
|
||||
|
||||
uint16_t mpdcch_repetition_cnt;
|
||||
@@ -923,7 +923,7 @@ typedef struct {
|
||||
uint8_t msg4_rrc_sdu_length;
|
||||
uint32_t msg4_delay;
|
||||
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
uint8_t rach_resource_type;
|
||||
uint8_t msg2_mpdcch_repetition_cnt;
|
||||
uint8_t msg2_mpdcch_done;
|
||||
@@ -985,7 +985,7 @@ typedef struct {
|
||||
uint32_t dl_CarrierFreq;
|
||||
BCCH_BCH_Message_t *mib;
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon_BR;
|
||||
#endif
|
||||
TDD_Config_t *tdd_Config;
|
||||
@@ -1012,7 +1012,7 @@ typedef struct {
|
||||
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
|
||||
/// number of subframe allocation pattern available for MBSFN sync area
|
||||
uint8_t num_sf_allocation_pattern;
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/// MBMS Flag
|
||||
uint8_t MBMS_flag;
|
||||
/// Outgoing MCCH pdu for PHY
|
||||
@@ -1034,7 +1034,7 @@ typedef struct {
|
||||
/// Outgoing MCH pdu for PHY
|
||||
MCH_PDU MCH_pdu;
|
||||
#endif
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
/// Rel13 parameters from SIB1
|
||||
SystemInformationBlockType1_v1310_IEs_t *sib1_v13ext;
|
||||
/// Counter for SIB1-BR scheduling
|
||||
@@ -1222,7 +1222,7 @@ typedef struct {
|
||||
struct RACH_ConfigDedicated *rach_ConfigDedicated;
|
||||
/// pointer to RRC PHY configuration
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated;
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/// pointer to RRC PHY configuration SCEll
|
||||
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10;
|
||||
#endif
|
||||
@@ -1298,7 +1298,7 @@ typedef struct {
|
||||
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8]; // FIXME replace 8 by MAX_MBSFN_AREA?
|
||||
/// number of subframe allocation pattern available for MBSFN sync area
|
||||
uint8_t num_sf_allocation_pattern;
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
/// number of active MBSFN area
|
||||
uint8_t num_active_mbsfn_area;
|
||||
/// MBSFN Area Info
|
||||
|
||||
@@ -261,12 +261,9 @@ schedule_SR(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
ul_req_body = &ul_req->ul_config_request_body;
|
||||
|
||||
// drop the allocation if the UE hasn't send RRCConnectionSetupComplete yet
|
||||
if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
//if (mac_eNB_get_rrc_status(module_idP, UE_RNTI(module_idP, UE_id)) < RRC_CONNECTED) continue;
|
||||
|
||||
AssertFatal(UE_list->
|
||||
UE_template[CC_id][UE_id].physicalConfigDedicated!= NULL,
|
||||
"physicalConfigDedicated is null for UE %d\n",
|
||||
UE_id);
|
||||
if (UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated== NULL) continue;
|
||||
|
||||
if ((SRconfig = UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->schedulingRequestConfig) != NULL) {
|
||||
if (SRconfig->present == LTE_SchedulingRequestConfig_PR_setup) {
|
||||
@@ -681,9 +678,9 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
|
||||
schedule_SR(module_idP, frameP, subframeP);
|
||||
// This schedules UCI_CSI in subframeP
|
||||
schedule_CSI(module_idP, frameP, subframeP);
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
// This schedules DLSCH in subframeP
|
||||
schedule_ue_spec_br(module_idP,frameP,subframeP);
|
||||
schedule_ue_spec_br(module_idP, frameP, subframeP);
|
||||
#endif
|
||||
// This schedules DLSCH in subframeP
|
||||
if (schedule_ue_spec_p != NULL) {
|
||||
|
||||
@@ -122,9 +122,9 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ra->rach_resource_type > 0) {
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n",
|
||||
LOG_D (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n",
|
||||
module_idP, frameP, subframeP, CC_id, ra->rach_resource_type - 1, ra->Msg3_frame, ra->Msg3_subframe);
|
||||
LOG_I (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n",
|
||||
LOG_D (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n",
|
||||
frameP, subframeP, ra->Msg3_frame, ra->Msg3_subframe, ra->msg3_nb_rb, ra->msg3_round);
|
||||
|
||||
ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
|
||||
@@ -239,21 +239,27 @@ add_msg3(module_id_t module_idP, int CC_id, RA_t * ra, frame_t frameP,
|
||||
} // non-BL/CE UE case
|
||||
}
|
||||
|
||||
void
|
||||
generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
sub_frame_t subframeP, RA_t * ra)
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Generate the RAR (message2)
|
||||
*/
|
||||
void generate_Msg2(module_id_t module_idP,
|
||||
int CC_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
RA_t *ra)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = mac->common_channels;
|
||||
|
||||
uint8_t *vrb_map;
|
||||
int first_rb;
|
||||
int N_RB_DL;
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
nfapi_dl_config_request_body_t *dl_req_body;
|
||||
uint8_t *vrb_map = NULL;
|
||||
int first_rb = 0;
|
||||
int N_RB_DL = 0;
|
||||
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = NULL;
|
||||
nfapi_tx_request_pdu_t *TX_req = NULL;
|
||||
nfapi_dl_config_request_body_t *dl_req_body = NULL;
|
||||
|
||||
vrb_map = cc[CC_idP].vrb_map;
|
||||
dl_req_body = &mac->DL_req[CC_idP].dl_config_request_body;
|
||||
@@ -261,74 +267,81 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int rmax = 0;
|
||||
int rep = 0;
|
||||
int reps = 0;
|
||||
int num_nb = 0;
|
||||
int rmax = 0;
|
||||
int rep = 0;
|
||||
int reps = 0;
|
||||
int num_nb = 0;
|
||||
|
||||
first_rb = 0;
|
||||
struct LTE_PRACH_ConfigSIB_v1310 *ext4_prach;
|
||||
LTE_PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13;
|
||||
struct LTE_PRACH_ConfigSIB_v1310 *ext4_prach = NULL;
|
||||
LTE_PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = NULL;
|
||||
LTE_PRACH_ParametersCE_r13_t *p[4] = { NULL, NULL, NULL, NULL };
|
||||
|
||||
uint16_t absSF = (10 * frameP) + subframeP;
|
||||
uint16_t absSF_Msg2 = (10 * ra->Msg2_frame) + ra->Msg2_subframe;
|
||||
uint16_t absSF = (10 * frameP) + subframeP;
|
||||
uint16_t absSF_Msg2 = (10 * ra->Msg2_frame) + ra->Msg2_subframe;
|
||||
|
||||
if (absSF > absSF_Msg2)
|
||||
return; // we're not ready yet, need to be to start ==
|
||||
|
||||
if (cc[CC_idP].mib->message.schedulingInfoSIB1_BR_r13 > 0 &&
|
||||
cc[CC_idP].radioResourceConfigCommon_BR) {
|
||||
if (absSF > absSF_Msg2) {
|
||||
return; // we're not ready yet
|
||||
}
|
||||
|
||||
if (cc[CC_idP].mib->message.schedulingInfoSIB1_BR_r13 > 0 && cc[CC_idP].radioResourceConfigCommon_BR) {
|
||||
ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
|
||||
prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
|
||||
|
||||
switch (prach_ParametersListCE_r13->list.count) {
|
||||
case 4:
|
||||
p[3] = prach_ParametersListCE_r13->list.array[3];
|
||||
case 3:
|
||||
p[2] = prach_ParametersListCE_r13->list.array[2];
|
||||
case 2:
|
||||
p[1] = prach_ParametersListCE_r13->list.array[1];
|
||||
case 1:
|
||||
p[0] = prach_ParametersListCE_r13->list.array[0];
|
||||
break;
|
||||
default:
|
||||
AssertFatal (1 == 0, "Illegal count for prach_ParametersListCE_r13 %d\n", (int) prach_ParametersListCE_r13->list.count);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
p[3] = prach_ParametersListCE_r13->list.array[3];
|
||||
case 3:
|
||||
p[2] = prach_ParametersListCE_r13->list.array[2];
|
||||
case 2:
|
||||
p[1] = prach_ParametersListCE_r13->list.array[1];
|
||||
case 1:
|
||||
p[0] = prach_ParametersListCE_r13->list.array[0];
|
||||
break;
|
||||
default:
|
||||
AssertFatal (1 == 0, "Illegal count for prach_ParametersListCE_r13 %d\n", (int) prach_ParametersListCE_r13->list.count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ra->rach_resource_type > 0) {
|
||||
/* This uses an MPDCCH Type 2 common allocation according to Section 9.1.5 36-213
|
||||
* Parameters:
|
||||
* p = 2 + 4 PRB set (number of PRB pairs 3)
|
||||
* rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3
|
||||
* if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates
|
||||
* if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates
|
||||
* distributed transmission
|
||||
*/
|
||||
|
||||
// This uses an MPDCCH Type 2 common allocation according to Section 9.1.5 36-213
|
||||
// Parameters:
|
||||
// p=2+4 PRB set (number of PRB pairs 3)
|
||||
// rmax = mpdcch-NumRepetition-RA-r13 => Table 9.1.5-3
|
||||
// if CELevel = 0,1 => Table 9.1.5-1b for MPDCCH candidates
|
||||
// if CELevel = 2,3 => Table 9.1.5-2b for MPDCCH candidates
|
||||
// distributed transmission
|
||||
|
||||
// rmax from SIB2 information
|
||||
AssertFatal (rmax < 9, "rmax>8!\n");
|
||||
/* rmax from SIB2 information */
|
||||
AssertFatal (rmax < 9, "rmax > 8!\n"); // not sure of this assertion
|
||||
rmax = 1 << p[ra->rach_resource_type - 1]->mpdcch_NumRepetition_RA_r13;
|
||||
// choose r1 by default for RAR (Table 9.1.5-5)
|
||||
|
||||
/* Choose r1 by default for RAR (Table 9.1.5-5) */
|
||||
rep = 0;
|
||||
// get actual repetition count from Table 9.1.5-3
|
||||
|
||||
/* Get actual repetition count from Table 9.1.5-3 */
|
||||
reps = (rmax <= 8) ? (1 << rep) : (rmax >> (3 - rep));
|
||||
// get narrowband according to higher-layer config
|
||||
|
||||
/* Get narrowband according to higher-layer config */
|
||||
num_nb = p[ra->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.count;
|
||||
ra->msg2_narrowband = *p[ra->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.array[ra->preamble_index % num_nb]-1;
|
||||
first_rb = narrowband_to_first_rb (&cc[CC_idP], ra->msg2_narrowband);
|
||||
ra->msg2_narrowband = *p[ra->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.array[ra->preamble_index % num_nb] - 1;
|
||||
first_rb = narrowband_to_first_rb(&cc[CC_idP], ra->msg2_narrowband);
|
||||
|
||||
if ((ra->msg2_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition (mac, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
|
||||
if ((ra->msg2_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition(mac, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
|
||||
ra->msg2_mpdcch_done = 0;
|
||||
// MPDCCH configuration for RAR
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2 for CE Level %d, Programming MPDCCH %d repetitions\n", module_idP, frameP, subframeP, ra->rach_resource_type-1,reps);
|
||||
|
||||
/* MPDCCH configuration for RAR */
|
||||
LOG_D(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2 for CE Level %d, Programming MPDCCH %d repetitions\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
ra->rach_resource_type - 1,
|
||||
reps);
|
||||
|
||||
memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t));
|
||||
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_mpdcch_pdu));
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.dci_format = (ra->rach_resource_type > 1) ? 11 : 10;
|
||||
@@ -336,7 +349,9 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6;
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space
|
||||
|
||||
AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
|
||||
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
|
||||
@@ -346,7 +361,7 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.drms_scrambling_init = cc[CC_idP].physCellId;
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.transmission_power = 6000; // 0dB
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV (6, 0, 6) | (ra->msg2_narrowband<<5);
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_coding = getRIV(6, 0, 6) | (ra->msg2_narrowband<<5);
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mcs = 0; // adjust according to size of RAR, 208 bits with N1A_PRB=3
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.pdsch_reptition_levels = 0; // fix to 4 for now
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.redundancy_version = 0;
|
||||
@@ -373,51 +388,64 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.direct_indication = 0;
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.total_dci_length_including_padding = 0; // this is not needed by OAI L1, but should be filled in
|
||||
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1;
|
||||
|
||||
ra->msg2_mpdcch_repetition_cnt++;
|
||||
dl_req_body->number_pdu++;
|
||||
ra->Msg2_subframe = (ra->Msg2_subframe + 9) % 10;
|
||||
} // repetition_count == 0 && SF condition met
|
||||
|
||||
} //repetition_count==0 && SF condition met
|
||||
if (ra->msg2_mpdcch_repetition_cnt > 0) { // we're in a stream of repetitions
|
||||
if ((ra->msg2_mpdcch_repetition_cnt == reps) && (ra->msg2_mpdcch_done == 0)) { // this is the last mpdcch repetition
|
||||
ra->msg2_mpdcch_done = 1;
|
||||
|
||||
|
||||
if ((ra->msg2_mpdcch_repetition_cnt == reps)&&
|
||||
(ra->msg2_mpdcch_done == 0)){ // this is the last mpdcch repetition
|
||||
ra->msg2_mpdcch_done = 1;
|
||||
if (cc[CC_idP].tdd_Config == NULL) { // FDD case
|
||||
if (cc[CC_idP].tdd_Config == NULL) { // FDD case
|
||||
// wait 2 subframes for PDSCH transmission
|
||||
if (subframeP > 7)
|
||||
ra->Msg2_frame = (frameP + 1) & 1023;
|
||||
else
|
||||
ra->Msg2_frame = frameP;
|
||||
ra->Msg2_subframe = (subframeP + 2) % 10; // +2 is the "n+x" from Section 7.1.11 in 36.213
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, programmed Msg2 for %d.%d\n", module_idP, frameP, subframeP, ra->Msg2_frame,ra->Msg2_subframe);
|
||||
ra->Msg2_subframe = (subframeP + 2) % 10; // +2 is the "n+x" from Section 7.1.11 in 36.213
|
||||
|
||||
LOG_D(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, programmed Msg2 for %d.%d\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
ra->Msg2_frame,
|
||||
ra->Msg2_subframe);
|
||||
} else {
|
||||
AssertFatal (1 == 0, "TDD case not done yet\n");
|
||||
AssertFatal(1 == 0, "TDD case not done yet\n");
|
||||
}
|
||||
} // mpdcch_repetition_count == reps
|
||||
else if (ra->msg2_mpdcch_done == 0) {
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", module_idP, frameP, subframeP, ra->msg2_mpdcch_repetition_cnt);
|
||||
} else if (ra->msg2_mpdcch_done == 0) { // mpdcch_repetition_count != reps
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
ra->msg2_mpdcch_repetition_cnt);
|
||||
|
||||
ra->msg2_mpdcch_repetition_cnt++;
|
||||
}
|
||||
|
||||
|
||||
if ((ra->Msg2_frame == frameP) && (ra->Msg2_subframe == subframeP)) {
|
||||
// Program PDSCH
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n", module_idP, frameP, subframeP);
|
||||
if((ra->Msg2_frame == frameP) && (ra->Msg2_subframe == subframeP)) {
|
||||
/* Program PDSCH */
|
||||
LOG_D(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP);
|
||||
|
||||
dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
|
||||
|
||||
memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t));
|
||||
|
||||
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DLSCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_dlsch_pdu));
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index = mac->pdu_index[CC_idP];
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV (N_RB_DL, first_rb, 6);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 6);
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; // QPSK
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_block_to_codeword_swap_flag = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_scheme = (cc[CC_idP].p_eNB == 1) ? 0 : 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.number_of_layers = 1;
|
||||
@@ -427,28 +455,36 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pa = 4; // 0 dB
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.delta_power_offset_index = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.ngap = 0;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize (cc[CC_idP].mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.nprb = get_subbandsize(cc[CC_idP].mib->message.dl_Bandwidth); // ignored
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc[CC_idP].p_eNB == 1) ? 1 : 2;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
|
||||
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
|
||||
|
||||
// Rel10 fields
|
||||
/* Rel10 fields */
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
|
||||
// Rel13 fields
|
||||
|
||||
/* Rel13 fields */
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (ra->rach_resource_type < 3) ? 1 : 2;;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10 * frameP) + subframeP;
|
||||
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.drms_table_flag = 0;
|
||||
dl_req_body->number_pdu++;
|
||||
|
||||
fill_rar_br (mac, CC_idP, ra, frameP, subframeP, cc[CC_idP].RAR_pdu.payload, ra->rach_resource_type - 1) ;
|
||||
// Program UL processing for Msg3, same as regular LTE
|
||||
fill_rar_br(mac, CC_idP, ra, frameP, subframeP, cc[CC_idP].RAR_pdu.payload, ra->rach_resource_type - 1);
|
||||
|
||||
/* Program UL processing for Msg3, same as regular LTE */
|
||||
get_Msg3alloc (&cc[CC_idP], subframeP, frameP, &ra->Msg3_frame, &ra->Msg3_subframe);
|
||||
add_msg3 (module_idP, CC_idP, ra, frameP, subframeP);
|
||||
ra->state = WAITMSG3;
|
||||
// DL request
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming TX Req\n", module_idP, frameP, subframeP);
|
||||
|
||||
ra->state = WAITMSG3;
|
||||
|
||||
/* DL request */
|
||||
LOG_D(MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming TX Req\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP);
|
||||
|
||||
mac->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
|
||||
TX_req = &mac->TX_req[CC_idP].tx_request_body.tx_pdu_list[mac->TX_req[CC_idP].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = 7; // This should be changed if we have more than 1 preamble
|
||||
@@ -459,7 +495,6 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
mac->TX_req[CC_idP].tx_request_body.number_of_pdus++;
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
|
||||
#endif
|
||||
@@ -571,104 +606,115 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
} // Msg2 frame/subframe condition
|
||||
} // else BL/CE
|
||||
}
|
||||
void
|
||||
generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
sub_frame_t subframeP, RA_t * ra)
|
||||
{
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Generate message 4 of RA procedure (RRC connection setup)
|
||||
*/
|
||||
void
|
||||
generate_Msg4(module_id_t module_idP,
|
||||
int CC_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
RA_t * ra)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = mac->common_channels;
|
||||
int16_t rrc_sdu_length;
|
||||
UE_list_t *UE_list = &(mac->UE_list);
|
||||
|
||||
int16_t rrc_sdu_length = 0;
|
||||
uint16_t msg4_padding = 0;
|
||||
uint16_t msg4_post_padding = 0;
|
||||
uint16_t msg4_header = 0;
|
||||
int UE_id = -1;
|
||||
uint16_t msg4_padding;
|
||||
uint16_t msg4_post_padding;
|
||||
uint16_t msg4_header;
|
||||
int first_rb = 0;
|
||||
int N_RB_DL = 0;
|
||||
uint8_t lcid = 0;
|
||||
uint8_t offset = 0;
|
||||
uint8_t *vrb_map = NULL;
|
||||
|
||||
uint8_t *vrb_map;
|
||||
int first_rb;
|
||||
int N_RB_DL;
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu;
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
UE_list_t *UE_list=&mac->UE_list;
|
||||
nfapi_dl_config_request_t *dl_req;
|
||||
nfapi_dl_config_request_body_t *dl_req_body;
|
||||
nfapi_ul_config_request_body_t *ul_req_body;
|
||||
uint8_t lcid;
|
||||
uint8_t offset;
|
||||
|
||||
nfapi_dl_config_request_pdu_t *dl_config_pdu = NULL;
|
||||
nfapi_ul_config_request_pdu_t *ul_config_pdu = NULL;
|
||||
nfapi_tx_request_pdu_t *TX_req = NULL;
|
||||
|
||||
nfapi_dl_config_request_t *dl_req = NULL;
|
||||
nfapi_dl_config_request_body_t *dl_req_body = NULL;
|
||||
nfapi_ul_config_request_body_t *ul_req_body = NULL;
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int rmax = 0;
|
||||
int rep = 0;
|
||||
int reps = 0;
|
||||
|
||||
int rmax = 0;
|
||||
int rep = 0;
|
||||
int reps = 0;
|
||||
|
||||
first_rb = 0;
|
||||
struct LTE_PRACH_ConfigSIB_v1310 *ext4_prach;
|
||||
struct LTE_PUCCH_ConfigCommon_v1310 *ext4_pucch;
|
||||
LTE_PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13;
|
||||
struct LTE_N1PUCCH_AN_InfoList_r13 *pucch_N1PUCCH_AN_InfoList_r13;
|
||||
|
||||
struct LTE_PRACH_ConfigSIB_v1310 *ext4_prach = NULL;
|
||||
struct LTE_PUCCH_ConfigCommon_v1310 *ext4_pucch = NULL;
|
||||
LTE_PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = NULL;
|
||||
struct LTE_N1PUCCH_AN_InfoList_r13 *pucch_N1PUCCH_AN_InfoList_r13 = NULL;
|
||||
LTE_PRACH_ParametersCE_r13_t *p[4] = { NULL, NULL, NULL, NULL };
|
||||
int pucchreps[4] = { 1, 1, 1, 1 };
|
||||
int n1pucchan[4] = { 0, 0, 0, 0 };
|
||||
|
||||
if (cc[CC_idP].mib->message.schedulingInfoSIB1_BR_r13 > 0 &&
|
||||
cc[CC_idP].radioResourceConfigCommon_BR) {
|
||||
if (cc[CC_idP].mib->message.schedulingInfoSIB1_BR_r13 > 0 && cc[CC_idP].radioResourceConfigCommon_BR) {
|
||||
|
||||
ext4_prach = cc[CC_idP].radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310;
|
||||
ext4_pucch = cc[CC_idP].radioResourceConfigCommon_BR->ext4->pucch_ConfigCommon_v1310;
|
||||
prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13;
|
||||
|
||||
ext4_pucch = cc[CC_idP].radioResourceConfigCommon_BR->ext4->pucch_ConfigCommon_v1310;
|
||||
pucch_N1PUCCH_AN_InfoList_r13 = ext4_pucch->n1PUCCH_AN_InfoList_r13;
|
||||
|
||||
AssertFatal (prach_ParametersListCE_r13 != NULL, "prach_ParametersListCE_r13 is null\n");
|
||||
AssertFatal (pucch_N1PUCCH_AN_InfoList_r13 != NULL, "pucch_N1PUCCH_AN_InfoList_r13 is null\n");
|
||||
// check to verify CE-Level compatibility in SIB2_BR
|
||||
|
||||
/* Check to verify CE-Level compatibility in SIB2_BR */
|
||||
AssertFatal (prach_ParametersListCE_r13->list.count == pucch_N1PUCCH_AN_InfoList_r13->list.count, "prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n");
|
||||
|
||||
switch (prach_ParametersListCE_r13->list.count) {
|
||||
case 4:
|
||||
p[3] = prach_ParametersListCE_r13->list.array[3];
|
||||
n1pucchan[3] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[3];
|
||||
AssertFatal (ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level3 shouldn't be NULL\n");
|
||||
pucchreps[3] = (int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13);
|
||||
|
||||
case 3:
|
||||
p[2] = prach_ParametersListCE_r13->list.array[2];
|
||||
n1pucchan[2] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[2];
|
||||
AssertFatal (ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level2 shouldn't be NULL\n");
|
||||
pucchreps[2] = (int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13);
|
||||
case 2:
|
||||
p[1] = prach_ParametersListCE_r13->list.array[1];
|
||||
n1pucchan[1] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[1];
|
||||
AssertFatal (ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level1 shouldn't be NULL\n");
|
||||
pucchreps[1] = (int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13);
|
||||
case 1:
|
||||
p[0] = prach_ParametersListCE_r13->list.array[0];
|
||||
n1pucchan[0] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[0];
|
||||
AssertFatal (ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level0 shouldn't be NULL\n");
|
||||
pucchreps[0] = (int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13);
|
||||
break;
|
||||
default:
|
||||
AssertFatal (1 == 0, "Illegal count for prach_ParametersListCE_r13 %d\n", prach_ParametersListCE_r13->list.count);
|
||||
case 4:
|
||||
p[3] = prach_ParametersListCE_r13->list.array[3];
|
||||
n1pucchan[3] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[3];
|
||||
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level3 shouldn't be NULL\n");
|
||||
pucchreps[3] = (int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level3_r13);
|
||||
|
||||
case 3:
|
||||
p[2] = prach_ParametersListCE_r13->list.array[2];
|
||||
n1pucchan[2] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[2];
|
||||
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level2 shouldn't be NULL\n");
|
||||
pucchreps[2] = (int) (4 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level2_r13);
|
||||
case 2:
|
||||
p[1] = prach_ParametersListCE_r13->list.array[1];
|
||||
n1pucchan[1] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[1];
|
||||
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level1 shouldn't be NULL\n");
|
||||
pucchreps[1] = (int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level1_r13);
|
||||
case 1:
|
||||
p[0] = prach_ParametersListCE_r13->list.array[0];
|
||||
n1pucchan[0] = *pucch_N1PUCCH_AN_InfoList_r13->list.array[0];
|
||||
AssertFatal(ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13 != NULL, "pucch_NumRepetitionCE_Msg4_Level0 shouldn't be NULL\n");
|
||||
pucchreps[0] = (int) (1 << *ext4_pucch->pucch_NumRepetitionCE_Msg4_Level0_r13);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Illegal count for prach_ParametersListCE_r13 %d\n", prach_ParametersListCE_r13->list.count);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
vrb_map = cc[CC_idP].vrb_map;
|
||||
|
||||
dl_req = &mac->DL_req[CC_idP];
|
||||
dl_req_body = &dl_req->dl_config_request_body;
|
||||
dl_config_pdu = &dl_req_body->dl_config_pdu_list[dl_req_body->number_pdu];
|
||||
|
||||
N_RB_DL = to_prb(cc[CC_idP].mib->message.dl_Bandwidth);
|
||||
|
||||
UE_id = find_UE_id(module_idP, ra->rnti);
|
||||
|
||||
if (UE_id < 0) {
|
||||
LOG_E(MAC,"Can't find UE for t-crnti %x, kill RA procedure for this UE\n",ra->rnti);
|
||||
LOG_E(MAC, "Can't find UE for t-crnti %x, kill RA procedure for this UE\n",
|
||||
ra->rnti);
|
||||
|
||||
cancel_ra_proc(module_idP, CC_idP, frameP, ra->rnti);
|
||||
return;
|
||||
}
|
||||
@@ -725,7 +771,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
AssertFatal (ra->msg4_rrc_sdu_length > 0, "[MAC][eNB Scheduler] CCCH not allocated\n");
|
||||
|
||||
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d, dl_req->num_pdu %d\n", module_idP, CC_idP, frameP, subframeP, UE_id, ra->msg4_rrc_sdu_length,dl_req_body->number_pdu);
|
||||
LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d, dl_req->num_pdu %d\n", module_idP, CC_idP, frameP, subframeP, UE_id, ra->msg4_rrc_sdu_length,dl_req_body->number_pdu);
|
||||
|
||||
// MPDCCH configuration for Msg4
|
||||
ra->msg4_mpdcch_done=0;
|
||||
@@ -783,7 +829,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
|
||||
if ((ra->msg4_mpdcch_repetition_cnt > 0)&&
|
||||
(ra->msg4_mpdcch_done==0)) { // we're in a stream of repetitions
|
||||
LOG_I(MAC,"SFN.SF %d.%d : msg4 mpdcch repetition number %d/%d\n",
|
||||
LOG_D(MAC,"SFN.SF %d.%d : msg4 mpdcch repetition number %d/%d\n",
|
||||
frameP,subframeP,ra->msg4_mpdcch_repetition_cnt,reps);
|
||||
if (ra->msg4_mpdcch_repetition_cnt == reps) { // this is the last mpdcch repetition
|
||||
ra->msg4_mpdcch_done = 1;
|
||||
@@ -794,7 +840,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
else
|
||||
ra->Msg4_frame = frameP;
|
||||
ra->Msg4_subframe = (subframeP + 2) % 10;
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Set Msg4 PDSCH in %d.%d\n",
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Set Msg4 PDSCH in %d.%d\n",
|
||||
module_idP, CC_idP, frameP, subframeP, ra->Msg4_frame,ra->Msg4_subframe);
|
||||
} else {
|
||||
AssertFatal (1 == 0, "TDD case not done yet\n");
|
||||
@@ -808,7 +854,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
|
||||
// Program PDSCH
|
||||
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (ce_level %d RNTI %x)\n",
|
||||
LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 BR with RRC Piggyback (ce_level %d RNTI %x)\n",
|
||||
module_idP, CC_idP, frameP, subframeP, ra->rach_resource_type - 1, ra->rnti);
|
||||
|
||||
|
||||
@@ -864,7 +910,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
msg4_post_padding = ra->msg4_TBsize - ra->msg4_rrc_sdu_length - msg4_header - 1;
|
||||
}
|
||||
|
||||
LOG_I (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n",
|
||||
LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n",
|
||||
module_idP, CC_idP, frameP, subframeP, ra->msg4_TBsize, ra->msg4_rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding);
|
||||
DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
|
||||
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
|
||||
@@ -1208,9 +1254,10 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
if (round != 8) {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
if (ra->rach_resource_type > 0) {
|
||||
if (ra->rach_resource_type > 0 && round > 0) {
|
||||
AssertFatal(1 == 0,
|
||||
"Msg4 Retransmissions not handled yet for BL/CE UEs\n");
|
||||
"Msg4 Retransmissions not handled yet for BL/CE UEs, Frame %d, subframeP %d harq_pid %d round %d, UE_id: %d \n",
|
||||
frameP, subframeP, ra->harq_pid, round, UE_id);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
@@ -1542,7 +1589,7 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
ra[i].RRC_timer = 20;
|
||||
ra[i].rnti = 0;
|
||||
ra[i].msg3_round = 0;
|
||||
LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Canceled RA procedure for UE rnti %x\n", module_idP, CC_id, frameP, rnti);
|
||||
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Canceled RA procedure for UE rnti %x\n", module_idP, CC_id, frameP, rnti);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1451,7 +1451,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS - ta_len - header_len_dcch - sdu_length_total - header_len_dtch
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, 0, 0
|
||||
#endif
|
||||
);
|
||||
@@ -1472,7 +1472,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
|
||||
lcid,
|
||||
TBS, //not used
|
||||
(char *)&dlsch_buffer[sdu_length_total]
|
||||
#ifdef Rel14
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, 0, 0
|
||||
#endif
|
||||
);
|
||||
|
||||
@@ -1951,8 +1951,7 @@ find_UE_id(module_id_t mod_idP,
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_ENB; UE_id++) {
|
||||
if (UE_list->active[UE_id] == TRUE) {
|
||||
if (UE_list->UE_template[UE_PCCID(mod_idP,
|
||||
UE_id)][UE_id].rnti == rntiP) {
|
||||
if (UE_list->UE_template[UE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) {
|
||||
return UE_id;
|
||||
}
|
||||
}
|
||||
@@ -4075,6 +4074,8 @@ extract_harq(module_id_t mod_idP,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC, "In extract_harq(): pdu[0] = %d for harq_pid = %d\n", pdu[0], harq_pid);
|
||||
|
||||
if (pdu[0] == 1) { // ACK
|
||||
sched_ctl->round[CC_idP][harq_pid] = 8; // release HARQ process
|
||||
sched_ctl->tbcnt[CC_idP][harq_pid] = 0;
|
||||
|
||||
@@ -458,9 +458,9 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
,ra->rach_resource_type > 0
|
||||
#endif
|
||||
);
|
||||
/* Prepare transmission of Msg4(RRCConnectionReconfiguration) */
|
||||
/* Received a new rnti */
|
||||
ra->state = MSGCRNTI;
|
||||
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) RRCConnectionReconfiguration(Msg4)\n",
|
||||
LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d : (rnti %x UE_id %d) Received rnti(Msg4)\n",
|
||||
enb_mod_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
@@ -686,9 +686,9 @@ rx_sdu(const module_id_t enb_mod_idP,
|
||||
rx_lengths[i],
|
||||
payload_ptr - sduP);
|
||||
|
||||
if ((UE_id = add_new_ue(enb_mod_idP, CC_idP, mac->common_channels[CC_idP].ra->rnti, harq_pid
|
||||
if ((UE_id = add_new_ue(enb_mod_idP, CC_idP, ra->rnti, harq_pid
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, mac->common_channels[CC_idP].ra->rach_resource_type
|
||||
, ra->rach_resource_type
|
||||
#endif
|
||||
)) == -1) {
|
||||
LOG_E(MAC,"[MAC][eNB] Max user count reached\n");
|
||||
@@ -1385,6 +1385,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
if (!ue_ul_slice_membership(module_idP, UE_id, slice_idx)) {
|
||||
continue;
|
||||
}
|
||||
if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].rach_resource_type > 0) continue;
|
||||
|
||||
// don't schedule if Msg5 is not received yet
|
||||
if (UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id].configured == FALSE) {
|
||||
@@ -1909,426 +1910,487 @@ schedule_ulsch_rnti(module_id_t module_idP,
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
* default ULSCH scheduler for LTE-M
|
||||
*/
|
||||
void schedule_ulsch_rnti_emtc(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
unsigned char sched_subframeP,
|
||||
int *emtc_active)
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
unsigned char sched_subframeP,
|
||||
int *emtc_active)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
int UE_id;
|
||||
int UE_id = -1;
|
||||
rnti_t rnti = -1;
|
||||
uint8_t round = 0;
|
||||
uint8_t round_UL = 0;
|
||||
uint8_t harq_pid = 0;
|
||||
uint8_t status = 0;
|
||||
uint32_t cshift,ndi;
|
||||
int32_t normalized_rx_power;
|
||||
int32_t target_rx_power=-90;
|
||||
int n;
|
||||
int CC_id = 0;
|
||||
int N_RB_UL;
|
||||
uint32_t cshift = 0;
|
||||
uint32_t ndi = 0;
|
||||
int32_t normalized_rx_power = 0;
|
||||
int32_t target_rx_power = -90;
|
||||
int n = 0;
|
||||
int CC_id = 0;
|
||||
int N_RB_UL = 0;
|
||||
int sched_frame = frameP;
|
||||
int rvidx_tab[4] = {0,2,3,1};
|
||||
int tpc = 0;
|
||||
int cqi_req = 0;
|
||||
eNB_MAC_INST *eNB = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = eNB->common_channels;
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
UE_TEMPLATE *UE_template;
|
||||
UE_sched_ctrl *UE_sched_ctrl;
|
||||
int sched_frame=frameP;
|
||||
int rvidx_tab[4] = {0,2,3,1};
|
||||
int tpc=0;
|
||||
int cqi_req=0;
|
||||
UE_list_t *UE_list = &(eNB->UE_list);
|
||||
UE_TEMPLATE *UE_template = NULL;
|
||||
UE_sched_ctrl *UE_sched_ctrl = NULL;
|
||||
|
||||
if (sched_subframeP<subframeP) sched_frame++;
|
||||
if (sched_subframeP < subframeP) {
|
||||
sched_frame++;
|
||||
}
|
||||
|
||||
nfapi_hi_dci0_request_body_t *hi_dci0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body;
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
|
||||
nfapi_hi_dci0_request_body_t *hi_dci0_req = &(eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body);
|
||||
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = NULL;
|
||||
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp = &eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body;
|
||||
nfapi_ul_config_request_body_t *ul_req_tmp = &(eNB->UL_req_tmp[CC_id][sched_subframeP].ul_config_request_body);
|
||||
|
||||
// loop over all active UEs
|
||||
if ((frameP&1) == 1) return;
|
||||
/* If frameP odd don't schedule */
|
||||
if ((frameP & 1) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) {
|
||||
/* Loop over all active UEs */
|
||||
for (UE_id = UE_list->head_ul; UE_id >= 0; UE_id = UE_list->next_ul[UE_id]) {
|
||||
UE_template = &(UE_list->UE_template[UE_PCCID(module_idP, UE_id)][UE_id]);
|
||||
|
||||
if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].rach_resource_type == 0) continue;
|
||||
/* LTE-M device */
|
||||
if (UE_template->rach_resource_type == 0) continue;
|
||||
|
||||
// don't schedule if Msg4 is not received yet
|
||||
if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) {
|
||||
LOG_D(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n",
|
||||
module_idP,frameP,subframeP,UE_id);
|
||||
/* Don't schedule if Msg4 is not received yet */
|
||||
if (UE_template->configured == FALSE) {
|
||||
LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d: not configured, skipping UE scheduling \n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
rnti = UE_RNTI(module_idP,UE_id);
|
||||
rnti = UE_RNTI(module_idP, UE_id);
|
||||
|
||||
if (rnti == NOT_A_RNTI) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d: no RNTI \n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id);
|
||||
|
||||
if (rnti==NOT_A_RNTI) {
|
||||
LOG_W(MAC,"[eNB %d] frame %d subfarme %d, UE %d: no RNTI \n", module_idP,frameP,subframeP,UE_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
// loop over all active UL CC_ids for this UE
|
||||
for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
|
||||
// This is the actual CC_id in the list
|
||||
CC_id = UE_list->ordered_ULCCids[n][UE_id];
|
||||
N_RB_UL = to_prb(cc[CC_id].ul_Bandwidth);
|
||||
/* Loop over all active UL CC_ids for this UE */
|
||||
for (n = 0; n < UE_list->numactiveULCCs[UE_id]; n++) {
|
||||
/* This is the actual CC_id in the list */
|
||||
CC_id = UE_list->ordered_ULCCids[n][UE_id];
|
||||
N_RB_UL = to_prb(cc[CC_id].ul_Bandwidth);
|
||||
|
||||
|
||||
UE_template = &UE_list->UE_template[CC_id][UE_id];
|
||||
UE_template = &(UE_list->UE_template[CC_id][UE_id]);
|
||||
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
|
||||
harq_pid = 0;
|
||||
round = UE_sched_ctrl->round_UL[CC_id][harq_pid];
|
||||
AssertFatal(round<8,"round %d > 7 for UE %d/%x\n",round,UE_id,rnti);
|
||||
round_UL = UE_sched_ctrl->round_UL[CC_id][harq_pid];
|
||||
|
||||
AssertFatal(round_UL < 8,"round_UL %d > 7 for UE %d/%x\n",
|
||||
round_UL,
|
||||
UE_id,
|
||||
rnti);
|
||||
|
||||
LOG_D(MAC,"[eNB %d] frame %d subframe %d,Checking PUSCH %d for BL/CE UE %d/%x CC %d : aggregation level %d, N_RB_UL %d\n",
|
||||
module_idP,frameP,subframeP,harq_pid,UE_id,rnti,CC_id, 24,N_RB_UL);
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
harq_pid,
|
||||
UE_id,
|
||||
rnti,
|
||||
CC_id,
|
||||
24, // agregation level
|
||||
N_RB_UL);
|
||||
|
||||
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->estimated_ul_buffer;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]);
|
||||
if ((UE_template->ul_SR >0 || round > 0 || status < RRC_CONNECTED)&&(subframeP==5))
|
||||
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
|
||||
{
|
||||
LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n",
|
||||
module_idP,harq_pid,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR,
|
||||
UE_sched_ctrl->ul_inactivity_timer,
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO, UE_template->estimated_ul_buffer);
|
||||
|
||||
//if ((UE_is_to_be_scheduled(module_idP, CC_id, UE_id) > 0) && (subframeP == 5)) {
|
||||
if ((UE_template->ul_SR > 0 || round_UL > 0 || status < RRC_CONNECTED) && (subframeP == 5)) {
|
||||
/*
|
||||
* if there is information on bsr of DCCH, DTCH,
|
||||
* or if there is UL_SR,
|
||||
* or if there is a packet to retransmit,
|
||||
* or we want to schedule a periodic feedback every frame
|
||||
*/
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d] Frame %d subframe %d Scheduling UE %d/%x in round_UL %d(SR %d,UL_inactivity timer %d,UL_failure timer %d,cqi_req_timer %d)\n",
|
||||
module_idP,
|
||||
harq_pid,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
rnti,
|
||||
round_UL,
|
||||
UE_template->ul_SR,
|
||||
UE_sched_ctrl->ul_inactivity_timer,
|
||||
UE_sched_ctrl->ul_failure_timer,
|
||||
UE_sched_ctrl->cqi_req_timer);
|
||||
|
||||
UE_sched_ctrl->ul_failure_timer,
|
||||
/* Reset the scheduling request */
|
||||
emtc_active[CC_id] = 1;
|
||||
UE_template->ul_SR = 0;
|
||||
status = mac_eNB_get_rrc_status(module_idP,rnti);
|
||||
cqi_req = 0;
|
||||
|
||||
UE_sched_ctrl->cqi_req_timer);
|
||||
// reset the scheduling request
|
||||
emtc_active[CC_id]=1;
|
||||
UE_template->ul_SR = 0;
|
||||
status = mac_eNB_get_rrc_status(module_idP,rnti);
|
||||
/* Power control: compute the expected ULSCH RX power (for the stats) */
|
||||
/* This is the normalized RX power and this should be constant (regardless of mcs) */
|
||||
normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id];
|
||||
target_rx_power = 178;
|
||||
|
||||
/*
|
||||
if (status < RRC_CONNECTED)
|
||||
cqi_req = 0;
|
||||
else if (UE_sched_ctrl->cqi_req_timer>300) {
|
||||
cqi_req = 1;
|
||||
UE_sched_ctrl->cqi_req_timer=0;
|
||||
|
||||
}
|
||||
else
|
||||
cqi_req = 0;
|
||||
*/
|
||||
cqi_req = 0;
|
||||
|
||||
|
||||
//power control
|
||||
//compute the expected ULSCH RX power (for the stats)
|
||||
|
||||
// this is the normalized RX power and this should be constant (regardless of mcs
|
||||
normalized_rx_power = UE_sched_ctrl->pusch_snr[CC_id];
|
||||
target_rx_power = 178;
|
||||
|
||||
// this assumes accumulated tpc
|
||||
// make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
|
||||
int32_t framex10psubframe = UE_template->pusch_tpc_tx_frame*10+UE_template->pusch_tpc_tx_subframe;
|
||||
if (((framex10psubframe+10)<=(frameP*10+subframeP)) || //normal case
|
||||
((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around
|
||||
{
|
||||
UE_template->pusch_tpc_tx_frame=frameP;
|
||||
UE_template->pusch_tpc_tx_subframe=subframeP;
|
||||
if (normalized_rx_power>(target_rx_power+4)) {
|
||||
tpc = 0; //-1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]--;
|
||||
} else if (normalized_rx_power<(target_rx_power-4)) {
|
||||
tpc = 2; //+1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
/* This assumes accumulated tpc */
|
||||
/* Make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out */
|
||||
int32_t framex10psubframe = UE_template->pusch_tpc_tx_frame * 10 + UE_template->pusch_tpc_tx_subframe;
|
||||
if (((framex10psubframe + 10) <= (frameP * 10 + subframeP)) || // normal case
|
||||
((framex10psubframe > (frameP * 10 + subframeP)) && (((10240 - framex10psubframe + frameP * 10 + subframeP) >= 10)))) // frame wrap-around
|
||||
{
|
||||
UE_template->pusch_tpc_tx_frame = frameP;
|
||||
UE_template->pusch_tpc_tx_subframe = subframeP;
|
||||
if (normalized_rx_power > (target_rx_power + 4)) {
|
||||
tpc = 0; //-1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]--;
|
||||
} else if (normalized_rx_power < (target_rx_power - 4)) {
|
||||
tpc = 2; //+1
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id]++;
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
} else {
|
||||
tpc = 1; //0
|
||||
}
|
||||
//tpc = 1;
|
||||
}
|
||||
|
||||
if (tpc != 1) {
|
||||
LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
|
||||
module_idP,
|
||||
frameP,
|
||||
subframeP,
|
||||
harq_pid,
|
||||
tpc,
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id],
|
||||
normalized_rx_power,
|
||||
target_rx_power);
|
||||
}
|
||||
|
||||
if (tpc!=1) {
|
||||
LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
|
||||
module_idP,frameP,subframeP,harq_pid,tpc,
|
||||
UE_sched_ctrl->tpc_accumulated[CC_id],normalized_rx_power,target_rx_power);
|
||||
/* New transmission */
|
||||
if (round_UL == 0) {
|
||||
ndi = 1 - UE_template->oldNDI_UL[harq_pid];
|
||||
|
||||
UE_template->oldNDI_UL[harq_pid] = ndi;
|
||||
UE_template->mcs_UL[harq_pid] = 4;
|
||||
UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid], 6);
|
||||
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power = normalized_rx_power;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power = target_rx_power;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1 = 4;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2 = UE_template->mcs_UL[harq_pid];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx += 6;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS = UE_template->TBS_UL[harq_pid];
|
||||
|
||||
T(T_ENB_MAC_UE_UL_SCHEDULE,
|
||||
T_INT(module_idP),
|
||||
T_INT(CC_id),
|
||||
T_INT(rnti),
|
||||
T_INT(frameP),
|
||||
T_INT(subframeP),
|
||||
T_INT(harq_pid),
|
||||
T_INT(UE_template->mcs_UL[harq_pid]),
|
||||
T_INT(0),
|
||||
T_INT(6),
|
||||
T_INT(UE_template->TBS_UL[harq_pid]),
|
||||
T_INT(ndi));
|
||||
|
||||
/* Store for possible retransmission */
|
||||
UE_template->nb_rb_ul[harq_pid] = 6;
|
||||
UE_sched_ctrl->ul_scheduled |= (1 << harq_pid);
|
||||
|
||||
if (UE_id == UE_list->head) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED, UE_sched_ctrl->ul_scheduled);
|
||||
}
|
||||
|
||||
// new transmission
|
||||
if (round==0) {
|
||||
/* Adjust total UL buffer status by TBS, wait for UL sdus to do final update */
|
||||
UE_template->scheduled_ul_bytes += UE_template->TBS_UL[harq_pid];
|
||||
|
||||
ndi = 1-UE_template->oldNDI_UL[harq_pid];
|
||||
UE_template->oldNDI_UL[harq_pid]=ndi;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power=normalized_rx_power;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=4;
|
||||
UE_template->mcs_UL[harq_pid] = 4;
|
||||
LOG_D(MAC, "scheduled_ul_bytes, new %d\n", UE_template->scheduled_ul_bytes);
|
||||
|
||||
/* Cyclic shift for DMRS */
|
||||
cshift = 0; // values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
|
||||
/* save it for a potential retransmission */
|
||||
UE_template->cshift[harq_pid] = cshift;
|
||||
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=UE_template->mcs_UL[harq_pid];
|
||||
// buffer_occupancy = UE_template->ul_total_buffer;
|
||||
AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4 != NULL, "UE_template->physicalConfigDedicated->ext4 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 != NULL, "UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present == LTE_EPDCCH_Config_r11__config_r11_PR_setup,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present != setup\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 = NULL\n");
|
||||
|
||||
LTE_EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11 = UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
|
||||
AssertFatal(epdcch_setconfig_r11 != NULL, "epdcch_setconfig_r11 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2 != NULL, "epdcch_setconfig_r11->ext2 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13 != NULL, "epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->present == LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->present is not setup\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 != NULL, "epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present == LTE_EPDCCH_SetConfig_r11__ext2__numberPRB_Pairs_v1310_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present is not setup\n");
|
||||
|
||||
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL 6-0A MPDCCH for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d, UESS MPDCCH Narrowband %d\n",
|
||||
harq_pid,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
rnti,
|
||||
sched_frame,
|
||||
sched_subframeP,
|
||||
(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1);
|
||||
|
||||
UE_template->TBS_UL[harq_pid] = get_TBS_UL(UE_template->mcs_UL[harq_pid],6);
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=6;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=UE_template->TBS_UL[harq_pid];
|
||||
// buffer_occupancy -= TBS;
|
||||
UE_template->first_rb_ul[harq_pid] = narrowband_to_first_rb (cc, epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1);
|
||||
|
||||
hi_dci0_pdu = &(hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci + hi_dci0_req->number_of_hi]);
|
||||
memset((void*) hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
|
||||
T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
|
||||
T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(0), T_INT(6),
|
||||
T_INT(UE_template->TBS_UL[harq_pid]), T_INT(ndi));
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_mpdcch_pdu));
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_format = (UE_template->rach_resource_type > 1) ? 5 : 4;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type > 1) ? 2 : 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_narrowband = epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_prb_pairs = 6; // checked above that it has to be this
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_transmission_type = epdcch_setconfig_r11->transmissionType_r11; // distibuted
|
||||
|
||||
// bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
|
||||
//store for possible retransmission
|
||||
UE_template->nb_rb_ul[harq_pid] = 6;
|
||||
AssertFatal(UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 is null\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.start_symbol = *UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.aggreagation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti_type = 4; // other
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti = rnti;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type < 3) ? 1 : 2; // already set above...
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.drms_scrambling_init = epdcch_setconfig_r11->dmrs_ScramblingSequenceInt_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.transmission_power = 6000; // 0dB
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_start = UE_template->first_rb_ul[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_resource_blocks = 6;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB = 3
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.pusch_repetition_levels = 0;
|
||||
|
||||
UE_sched_ctrl->ul_scheduled |= (1<<harq_pid);
|
||||
if (UE_id == UE_list->head)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled);
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13 == LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_pdsch_HoppingConfig_r13_off,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->mpdcch_pdsch_HoppingConfig_r13 is not off\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.frequency_hopping_flag = 1 - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.redudency_version = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.new_data_indication = UE_template->oldNDI_UL[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.harq_process = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tpc = tpc;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.csi_request = cqi_req;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ul_inex = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dai_presence_flag = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dl_assignment_index = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.srs_request = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_subframe_repetition_number = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tcp_bitmap = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.total_dci_length_include_padding = 29; // hard-coded for 10 MHz
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_tx_antenna_ports = 1;
|
||||
|
||||
// adjust total UL buffer status by TBS, wait for UL sdus to do final update
|
||||
UE_template->scheduled_ul_bytes += UE_template->TBS_UL[harq_pid];
|
||||
hi_dci0_req->number_of_dci++;
|
||||
|
||||
LOG_D(MAC, "scheduled_ul_bytes, new %d\n", UE_template->scheduled_ul_bytes);
|
||||
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG. Request for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d, UESS mpdcch narrowband %d\n",
|
||||
harq_pid,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
rnti,
|
||||
sched_frame,
|
||||
sched_subframeP,
|
||||
(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1);
|
||||
|
||||
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
cqi_req,
|
||||
cc,
|
||||
UE_template->physicalConfigDedicated,
|
||||
get_tmode(module_idP,CC_id,UE_id),
|
||||
eNB->ul_handle,
|
||||
rnti,
|
||||
UE_template->first_rb_ul[harq_pid], // resource_block_start
|
||||
UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks
|
||||
UE_template->mcs_UL[harq_pid],
|
||||
cshift, // cyclic_shift_2_for_drms
|
||||
0, // frequency_hopping_enabled_flag
|
||||
0, // frequency_hopping_bits
|
||||
UE_template->oldNDI_UL[harq_pid], // new_data_indication
|
||||
rvidx_tab[round_UL&3], // redundancy_version
|
||||
harq_pid, // harq_process_number
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
UE_template->TBS_UL[harq_pid]
|
||||
);
|
||||
|
||||
// Cyclic shift for DM RS
|
||||
cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
|
||||
// save it for a potential retransmission
|
||||
UE_template->cshift[harq_pid] = cshift;
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
UE_template->rach_resource_type > 2 ? 2 : 1,
|
||||
1, // total_number_of_repetitions
|
||||
1, // repetition_number
|
||||
(frameP * 10) + subframeP);
|
||||
|
||||
ul_req_tmp->number_of_pdus++;
|
||||
eNB->ul_handle++;
|
||||
|
||||
AssertFatal (UE_template->physicalConfigDedicated != NULL,
|
||||
"UE_template->physicalConfigDedicated is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present == LTE_EPDCCH_Config_r11__config_r11_PR_setup,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present != setup\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 = NULL\n");
|
||||
LTE_EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11 = UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
AssertFatal(epdcch_setconfig_r11 != NULL, "epdcch_setconfig_r11 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2!=NULL, "epdcch_setconfig_r11->ext2 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->present==LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->present is not setup\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present==LTE_EPDCCH_SetConfig_r11__ext2__numberPRB_Pairs_v1310_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present is not setup\n");
|
||||
add_ue_ulsch_info(module_idP,
|
||||
CC_id,
|
||||
UE_id,
|
||||
subframeP,
|
||||
S_UL_SCHEDULED);
|
||||
|
||||
LOG_I(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL 6-0A MPDCCH for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d,UESS MPDCCH Narrowband %d\n",
|
||||
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP,(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n",
|
||||
module_idP,
|
||||
CC_id,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id);
|
||||
|
||||
UE_template->first_rb_ul[harq_pid] = narrowband_to_first_rb (cc,
|
||||
epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi];
|
||||
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
} else { // round_UL > 0 => retransmission
|
||||
/* In LTE-M the UL HARQ process is asynchronous */
|
||||
T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION,
|
||||
T_INT(module_idP),
|
||||
T_INT(CC_id),
|
||||
T_INT(rnti),
|
||||
T_INT(frameP),
|
||||
T_INT(subframeP),
|
||||
T_INT(harq_pid),
|
||||
T_INT(UE_template->mcs_UL[harq_pid]),
|
||||
T_INT(0),
|
||||
T_INT(6),
|
||||
T_INT(round_UL));
|
||||
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_mpdcch_pdu));
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_format = (UE_template->rach_resource_type > 1) ? 5 : 4;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type > 1) ? 2 : 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_narrowband = epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1;
|
||||
AssertFatal (UE_template->physicalConfigDedicated != NULL, "UE_template->physicalConfigDedicated is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4 != NULL, "UE_template->physicalConfigDedicated->ext4 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 != NULL, "UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present == LTE_EPDCCH_Config_r11__config_r11_PR_setup,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present != setup\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 = NULL\n");
|
||||
|
||||
LTE_EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11 = UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
|
||||
AssertFatal(epdcch_setconfig_r11 != NULL, "epdcch_setconfig_r11 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2 != NULL, "epdcch_setconfig_r11->ext2 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13 != NULL, "epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13 != NULL, "epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->present == LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->present is not setup\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 != NULL, "epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present == LTE_EPDCCH_SetConfig_r11__ext2__numberPRB_Pairs_v1310_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present is not setup\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_prb_pairs = 6; // checked above that it has to be this
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_transmission_type = epdcch_setconfig_r11->transmissionType_r11; // distibuted
|
||||
LOG_D(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL 6-0A MPDCCH for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d,UESS MPDCCH Narrowband %d\n",
|
||||
harq_pid,
|
||||
frameP,
|
||||
subframeP,
|
||||
UE_id,
|
||||
rnti,
|
||||
sched_frame,
|
||||
sched_subframeP,
|
||||
(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1);
|
||||
|
||||
AssertFatal(UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11!=NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 is null\n");
|
||||
UE_template->first_rb_ul[harq_pid] = narrowband_to_first_rb(cc, epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
|
||||
hi_dci0_pdu = &(hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi]);
|
||||
|
||||
memset((void*) hi_dci0_pdu, 0, sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.start_symbol = *UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.aggreagation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti_type = 4; // other
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti = rnti;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type < 3) ? 1 : 2;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.drms_scrambling_init = epdcch_setconfig_r11->dmrs_ScramblingSequenceInt_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.transmission_power = 6000; // 0dB
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_start = UE_template->first_rb_ul[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_resource_blocks = 6;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.pusch_repetition_levels = 0;
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13==
|
||||
LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_pdsch_HoppingConfig_r13_off,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->mpdcch_pdsch_HoppingConfig_r13 is not off\n");
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.frequency_hopping_flag = 1-epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.redudency_version = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.new_data_indication = UE_template->oldNDI_UL[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.harq_process = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tpc = tpc;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.csi_request = cqi_req;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ul_inex = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dai_presence_flag = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dl_assignment_index = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.srs_request = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_subframe_repetition_number = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tcp_bitmap = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.total_dci_length_include_padding = 29; // hard-coded for 10 MHz
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_tx_antenna_ports = 1;
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_mpdcch_pdu));
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_format = (UE_template->rach_resource_type > 1) ? 5 : 4;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type > 1) ? 2 : 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_narrowband = epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13 - 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_prb_pairs = 6; // checked above that it has to be this
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_transmission_type = epdcch_setconfig_r11->transmissionType_r11; // distibuted
|
||||
|
||||
hi_dci0_req->number_of_dci++;
|
||||
AssertFatal(UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 is null\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.start_symbol = *UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.aggreagation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti_type = 4; // other
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti = rnti;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type < 3) ? 1 : 2;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.drms_scrambling_init = epdcch_setconfig_r11->dmrs_ScramblingSequenceInt_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.transmission_power = 6000; // 0dB
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_start = UE_template->first_rb_ul[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_resource_blocks = 6;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.pusch_repetition_levels = 0;
|
||||
|
||||
LOG_I(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL CONFIG.Request for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d, UESS mpdcch narrowband %d\n",
|
||||
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP,
|
||||
(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13 == LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_pdsch_HoppingConfig_r13_off,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->mpdcch_pdsch_HoppingConfig_r13 is not off\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.frequency_hopping_flag = 1 - epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.redudency_version = rvidx_tab[round_UL&3];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.new_data_indication = UE_template->oldNDI_UL[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.harq_process = harq_pid;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tpc = tpc;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.csi_request = cqi_req;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ul_inex = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dai_presence_flag = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dl_assignment_index = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.srs_request = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_subframe_repetition_number = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tcp_bitmap = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.total_dci_length_include_padding = 29; // hard-coded for 10 MHz
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_tx_antenna_ports = 1;
|
||||
|
||||
hi_dci0_req->number_of_dci++;
|
||||
|
||||
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
cqi_req,
|
||||
cc,
|
||||
UE_template->physicalConfigDedicated,
|
||||
get_tmode(module_idP,CC_id,UE_id),
|
||||
eNB->ul_handle,
|
||||
rnti,
|
||||
UE_template->first_rb_ul[harq_pid], // resource_block_start
|
||||
UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks
|
||||
UE_template->mcs_UL[harq_pid],
|
||||
cshift, // cyclic_shift_2_for_drms
|
||||
0, // frequency_hopping_enabled_flag
|
||||
0, // frequency_hopping_bits
|
||||
UE_template->oldNDI_UL[harq_pid], // new_data_indication
|
||||
rvidx_tab[round&3], // redundancy_version
|
||||
harq_pid, // harq_process_number
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
UE_template->TBS_UL[harq_pid]
|
||||
);
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
UE_template->rach_resource_type>2 ? 2 : 1,
|
||||
1, //total_number_of_repetitions
|
||||
1, //repetition_number
|
||||
(frameP*10)+subframeP);
|
||||
|
||||
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
cqi_req,
|
||||
cc,
|
||||
UE_template->physicalConfigDedicated,
|
||||
get_tmode(module_idP,CC_id,UE_id),
|
||||
eNB->ul_handle,
|
||||
rnti,
|
||||
UE_template->first_rb_ul[harq_pid], // resource_block_start
|
||||
UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks
|
||||
UE_template->mcs_UL[harq_pid],
|
||||
cshift, // cyclic_shift_2_for_drms
|
||||
0, // frequency_hopping_enabled_flag
|
||||
0, // frequency_hopping_bits
|
||||
UE_template->oldNDI_UL[harq_pid], // new_data_indication
|
||||
rvidx_tab[round_UL&3], // redundancy_version
|
||||
harq_pid, // harq_process_number
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
UE_template->TBS_UL[harq_pid]
|
||||
);
|
||||
|
||||
ul_req_tmp->number_of_pdus++;
|
||||
eNB->ul_handle++;
|
||||
|
||||
add_ue_ulsch_info(module_idP,
|
||||
CC_id,
|
||||
UE_id,
|
||||
subframeP,
|
||||
S_UL_SCHEDULED);
|
||||
|
||||
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
|
||||
|
||||
}
|
||||
else { // round > 0 => retransmission
|
||||
T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
|
||||
T_INT(subframeP), T_INT(harq_pid), T_INT(UE_template->mcs_UL[harq_pid]), T_INT(0), T_INT(6),
|
||||
T_INT(round));
|
||||
|
||||
AssertFatal (UE_template->physicalConfigDedicated != NULL,
|
||||
"UE_template->physicalConfigDedicated is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11 is null\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present == LTE_EPDCCH_Config_r11__config_r11_PR_setup,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.present != setup\n");
|
||||
AssertFatal (UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 != NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11 = NULL\n");
|
||||
LTE_EPDCCH_SetConfig_r11_t *epdcch_setconfig_r11 = UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.setConfigToAddModList_r11->list.array[0];
|
||||
AssertFatal(epdcch_setconfig_r11 != NULL, "epdcch_setconfig_r11 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2!=NULL, "epdcch_setconfig_r11->ext2 is null\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->present==LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->present is not setup\n");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310!=NULL,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310 is null");
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present==LTE_EPDCCH_SetConfig_r11__ext2__numberPRB_Pairs_v1310_PR_setup,
|
||||
"epdcch_setconfig_r11->ext2->numberPRB_Pairs_v1310->present is not setup\n");
|
||||
|
||||
LOG_I(MAC,"[PUSCH %d] Frame %d, Subframe %d: Adding UL 6-0A MPDCCH for BL/CE UE %d/%x, ulsch_frame %d, ulsch_subframe %d,UESS MPDCCH Narrowband %d\n",
|
||||
harq_pid,frameP,subframeP,UE_id,rnti,sched_frame,sched_subframeP,(int)epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
|
||||
UE_template->first_rb_ul[harq_pid] = narrowband_to_first_rb (cc,
|
||||
epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1);
|
||||
hi_dci0_pdu = &hi_dci0_req->hi_dci0_pdu_list[hi_dci0_req->number_of_dci+hi_dci0_req->number_of_hi];
|
||||
memset((void*)hi_dci0_pdu,0,sizeof(nfapi_hi_dci0_request_pdu_t));
|
||||
|
||||
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_MPDCCH_DCI_PDU_TYPE;
|
||||
hi_dci0_pdu->pdu_size = (uint8_t) (2 + sizeof (nfapi_dl_config_mpdcch_pdu));
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_format = (UE_template->rach_resource_type > 1) ? 5 : 4;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type > 1) ? 2 : 1;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_narrowband = epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_Narrowband_r13-1;
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_prb_pairs = 6; // checked above that it has to be this
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mpdcch_transmission_type = epdcch_setconfig_r11->transmissionType_r11; // distibuted
|
||||
|
||||
AssertFatal(UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11!=NULL,
|
||||
"UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11 is null\n");
|
||||
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.start_symbol = *UE_template->physicalConfigDedicated->ext4->epdcch_Config_r11->config_r11.choice.setup.startSymbol_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.aggreagation_level = 24; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti_type = 4; // other
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.rnti = rnti;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ce_mode = (UE_template->rach_resource_type < 3) ? 1 : 2;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.drms_scrambling_init = epdcch_setconfig_r11->dmrs_ScramblingSequenceInt_r11;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.initial_transmission_sf_io = (frameP * 10) + subframeP;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.transmission_power = 6000; // 0dB
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.resource_block_start = UE_template->first_rb_ul[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_resource_blocks = 6;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.mcs = 4; // adjust according to size of RAR, 208 bits with N1A_PRB=3
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.pusch_repetition_levels = 0;
|
||||
AssertFatal(epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13==
|
||||
LTE_EPDCCH_SetConfig_r11__ext2__mpdcch_config_r13__setup__mpdcch_pdsch_HoppingConfig_r13_off,
|
||||
"epdcch_setconfig_r11->ext2->mpdcch_config_r13->mpdcch_pdsch_HoppingConfig_r13 is not off\n");
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.frequency_hopping_flag = 1-epdcch_setconfig_r11->ext2->mpdcch_config_r13->choice.setup.mpdcch_pdsch_HoppingConfig_r13;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.redudency_version = rvidx_tab[round&3];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.new_data_indication = UE_template->oldNDI_UL[harq_pid];
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.harq_process = harq_pid;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tpc = tpc;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.csi_request = cqi_req;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.ul_inex = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dai_presence_flag = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dl_assignment_index = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.srs_request = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.dci_subframe_repetition_number = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.tcp_bitmap = 0;
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.total_dci_length_include_padding = 29; // hard-coded for 10 MHz
|
||||
hi_dci0_pdu->mpdcch_dci_pdu.mpdcch_dci_pdu_rel13.number_of_tx_antenna_ports = 1;
|
||||
|
||||
hi_dci0_req->number_of_dci++;
|
||||
fill_nfapi_ulsch_config_request_rel8(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
cqi_req,
|
||||
cc,
|
||||
UE_template->physicalConfigDedicated,
|
||||
get_tmode(module_idP,CC_id,UE_id),
|
||||
eNB->ul_handle,
|
||||
rnti,
|
||||
UE_template->first_rb_ul[harq_pid], // resource_block_start
|
||||
UE_template->nb_rb_ul[harq_pid], // number_of_resource_blocks
|
||||
UE_template->mcs_UL[harq_pid],
|
||||
cshift, // cyclic_shift_2_for_drms
|
||||
0, // frequency_hopping_enabled_flag
|
||||
0, // frequency_hopping_bits
|
||||
UE_template->oldNDI_UL[harq_pid], // new_data_indication
|
||||
rvidx_tab[round&3], // redundancy_version
|
||||
harq_pid, // harq_process_number
|
||||
0, // ul_tx_mode
|
||||
0, // current_tx_nb
|
||||
0, // n_srs
|
||||
UE_template->TBS_UL[harq_pid]
|
||||
);
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
UE_template->rach_resource_type>2 ? 2 : 1,
|
||||
1, //total_number_of_repetitions
|
||||
1, //repetition_number
|
||||
(frameP*10)+subframeP);
|
||||
|
||||
ul_req_tmp->number_of_pdus++;
|
||||
eNB->ul_handle++;
|
||||
|
||||
}
|
||||
} // UE_is_to_be_scheduled
|
||||
fill_nfapi_ulsch_config_request_emtc(&ul_req_tmp->ul_config_pdu_list[ul_req_tmp->number_of_pdus],
|
||||
UE_template->rach_resource_type>2 ? 2 : 1,
|
||||
1, //total_number_of_repetitions
|
||||
1, //repetition_number
|
||||
(frameP * 10) + subframeP);
|
||||
|
||||
ul_req_tmp->number_of_pdus++;
|
||||
eNB->ul_handle++;
|
||||
}
|
||||
} // UE_is_to_be_scheduled
|
||||
} // ULCCs
|
||||
} // loop over UE_id
|
||||
}
|
||||
|
||||
@@ -110,98 +110,124 @@ fill_rar(const module_id_t module_idP,
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Fill the RAR buffer (header + PDU) for LTE-M devices
|
||||
*/
|
||||
unsigned short fill_rar_br(eNB_MAC_INST *eNB,
|
||||
int CC_id,
|
||||
RA_t *ra,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
uint8_t* const dlsch_buffer,
|
||||
const uint8_t ce_level
|
||||
)
|
||||
int CC_id,
|
||||
RA_t *ra,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
uint8_t* const dlsch_buffer,
|
||||
const uint8_t ce_level)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer;
|
||||
RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *) dlsch_buffer;
|
||||
COMMON_channels_t *cc = &eNB->common_channels[CC_id];
|
||||
uint8_t *rar = (uint8_t *)(dlsch_buffer+1);
|
||||
|
||||
uint32_t rballoc,reps;
|
||||
uint32_t TPC,ULdelay,cqireq,mpdcch_nb_index;
|
||||
int input_buffer_length;
|
||||
uint8_t *rar = (uint8_t *)(dlsch_buffer + 1);
|
||||
|
||||
uint32_t rballoc = 0;
|
||||
uint32_t reps = 0;
|
||||
uint32_t ULdelay = 0;
|
||||
uint32_t cqireq = 0;
|
||||
uint32_t mpdcch_nb_index = 0;
|
||||
uint32_t TPC = 0;
|
||||
int input_buffer_length = 0;
|
||||
int N_NB_index = 0;
|
||||
|
||||
AssertFatal(ra != NULL, "RA is null \n");
|
||||
|
||||
// subheader fixed
|
||||
/* Subheader fixed */
|
||||
rarh->E = 0; // First and last RAR
|
||||
rarh->T = 1; // 0 for E/T/R/R/BI subheader, 1 for E/T/RAPID subheader
|
||||
rarh->RAPID = ra->preamble_index; // Respond to Preamble 0 only for the moment
|
||||
ra->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps
|
||||
rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
|
||||
rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
|
||||
rarh->RAPID = ra->preamble_index; // Respond to Preamble
|
||||
|
||||
/* RAR PDU */
|
||||
/* TA Command */
|
||||
ra->timing_offset /= 16; // T_A = N_TA/16, where N_TA should be on a 30.72Msps
|
||||
rar[0] = (uint8_t) (ra->timing_offset >> 4) & 0x7f; // 7 MSBs of timing advance
|
||||
rar[1] = (uint8_t) (ra->timing_offset & 0x0f) << 4; // 4 LSBs of timing advance
|
||||
|
||||
int N_NB_index;
|
||||
|
||||
// Copy the Msg2 narrowband
|
||||
/* Copy the Msg2 narrowband */
|
||||
ra->msg34_narrowband = ra->msg2_narrowband;
|
||||
ra->msg3_first_rb = 0;
|
||||
ra->msg3_nb_rb = 2;
|
||||
|
||||
|
||||
if (ce_level < 2) { //CE Level 0,1, CEmodeA
|
||||
if (ce_level < 2) { // CE Level 0, 1 (CEmodeA)
|
||||
input_buffer_length = 6;
|
||||
|
||||
N_NB_index = get_numnarrowbandbits(cc->mib->message.dl_Bandwidth);
|
||||
|
||||
rar[4] = (uint8_t)(ra->rnti>>8);
|
||||
rar[5] = (uint8_t)(ra->rnti&0xff);
|
||||
//cc->ra[ra_idx].timing_offset = 0;
|
||||
|
||||
/* UL Grant */
|
||||
reps = 0;
|
||||
ra->msg3_mcs = 7;
|
||||
TPC = 3; // no power increase
|
||||
ULdelay = 0;
|
||||
cqireq = 0;
|
||||
mpdcch_nb_index = 0;
|
||||
rballoc = mac_computeRIV(6,ra->msg3_first_rb,ra->msg3_nb_rb);
|
||||
rballoc = mac_computeRIV(6, ra->msg3_first_rb, ra->msg3_nb_rb);
|
||||
|
||||
uint32_t buffer = 0;
|
||||
buffer |= ra->msg34_narrowband << (16 + (4 - N_NB_index));
|
||||
buffer |= ((rballoc & 0xFF) << (12 + (4 - N_NB_index)));
|
||||
buffer |= ((rballoc & 0x0F) << (12 + (4 - N_NB_index)));
|
||||
buffer |= ((reps & 0x03) << (10 + (4 - N_NB_index)));
|
||||
buffer |= ((ra->msg3_mcs & 0x07) << (7 + (4 - N_NB_index)));
|
||||
buffer |= ((TPC & 0x07) << (4 + (4 - N_NB_index)));
|
||||
buffer |= ((cqireq & 0x01) << (3 + (4 - N_NB_index)));
|
||||
buffer |= ((ULdelay & 0x01) << (2 + (4 - N_NB_index)));
|
||||
buffer |= (mpdcch_nb_index << (4 - N_NB_index));
|
||||
rar[1] = (buffer>>16) & 0x0F;
|
||||
rar[2] = (buffer>>8) & 0xFF;
|
||||
rar[3] = buffer&0xFF;
|
||||
|
||||
rar[1] |= (uint8_t) (buffer >> 16) & 0x0F;
|
||||
rar[2] = (uint8_t) (buffer >> 8) & 0xFF;
|
||||
rar[3] = (uint8_t) buffer & 0xFF;
|
||||
|
||||
/* RA CRNTI */
|
||||
rar[4] = (uint8_t)(ra->rnti >> 8);
|
||||
rar[5] = (uint8_t)(ra->rnti & 0xff);
|
||||
|
||||
} else { // CE level 2, 3 (CEModeB)
|
||||
|
||||
AssertFatal(1 == 0, "Shouldn't get here ...\n");
|
||||
|
||||
input_buffer_length = 5;
|
||||
|
||||
rar[3] = (uint8_t)(ra->rnti >> 8);
|
||||
rar[4] = (uint8_t)(ra->rnti & 0xff);
|
||||
}
|
||||
else { // CE level 2,3 => CEModeB
|
||||
|
||||
AssertFatal(1==0,"Shouldn't get here ...\n");
|
||||
input_buffer_length =5;
|
||||
|
||||
|
||||
rar[3] = (uint8_t)(ra->rnti>>8);
|
||||
rar[4] = (uint8_t)(ra->rnti&0xff);
|
||||
}
|
||||
LOG_I(MAC,"[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",
|
||||
frameP,subframeP,
|
||||
*(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5],
|
||||
LOG_I(MAC, "[RAPROC] Frame %d Subframe %d : Generating RAR BR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ce_level %d, CRNTI %x, preamble %d/%d, TIMING OFFSET %d\n",
|
||||
frameP,
|
||||
subframeP,
|
||||
*(uint8_t*) rarh,
|
||||
rar[0],
|
||||
rar[1],
|
||||
rar[2],
|
||||
rar[3],
|
||||
rar[4],
|
||||
rar[5],
|
||||
ce_level,
|
||||
ra->rnti,
|
||||
rarh->RAPID,ra->preamble_index,
|
||||
rarh->RAPID,
|
||||
ra->preamble_index,
|
||||
ra->timing_offset);
|
||||
|
||||
if (opt_enabled) {
|
||||
trace_pdu(DIRECTION_DOWNLINK , dlsch_buffer, input_buffer_length, eNB->Mod_id, WS_RA_RNTI , 1,
|
||||
eNB->frame, eNB->subframe, 0, 0);
|
||||
LOG_D(OPT,
|
||||
"[RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n",
|
||||
frameP, ra->rnti, rarh->RAPID, input_buffer_length);
|
||||
trace_pdu(DIRECTION_DOWNLINK,
|
||||
dlsch_buffer,
|
||||
input_buffer_length,
|
||||
eNB->Mod_id,
|
||||
WS_RA_RNTI,
|
||||
1,
|
||||
eNB->frame,
|
||||
eNB->subframe,
|
||||
0,
|
||||
0);
|
||||
|
||||
LOG_D(OPT, "[RAPROC] RAR Frame %d trace pdu for rnti %x and rapid %d size %d\n",
|
||||
frameP,
|
||||
ra->rnti,
|
||||
rarh->RAPID,
|
||||
input_buffer_length);
|
||||
}
|
||||
|
||||
return (ra->rnti);
|
||||
|
||||
@@ -135,7 +135,7 @@ rrc_data_ind(
|
||||
LOG_I(RRC, "[UE %x] Frame %d: received a DCCH %d message on SRB %d with Size %d from eNB %d\n",
|
||||
ctxt_pP->module_id, ctxt_pP->frame, DCCH_index,Srb_id,sdu_sizeP, ctxt_pP->eNB_index);
|
||||
} else {
|
||||
LOG_I(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %x\n",
|
||||
LOG_D(RRC, "[eNB %d] Frame %d: received a DCCH %d message on SRB %d with Size %d from UE %x\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame,
|
||||
DCCH_index,
|
||||
|
||||
@@ -3083,6 +3083,27 @@ uint8_t do_RRCConnectionSetup_BR(
|
||||
physicalConfigDedicated2->ext7->csi_RS_ConfigNZPToReleaseListExt_r13 = NULL;
|
||||
|
||||
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig = CALLOC(1,sizeof(struct LTE_RadioResourceConfigDedicated__mac_MainConfig));
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig->present = LTE_RadioResourceConfigDedicated__mac_MainConfig_PR_explicitValue;
|
||||
LTE_MAC_MainConfig_t *mac_MainConfig = &rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig->choice.explicitValue;
|
||||
mac_MainConfig->ul_SCH_Config = CALLOC(1, sizeof(*mac_MainConfig->ul_SCH_Config));
|
||||
//long *maxHARQ_Tx = CALLOC(1, sizeof(long));
|
||||
//*maxHARQ_Tx = LTE_MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
|
||||
long *periodicBSR_Timer = CALLOC(1, sizeof(long));
|
||||
*periodicBSR_Timer = LTE_PeriodicBSR_Timer_r12_sf64;
|
||||
//mac_MainConfig->ul_SCH_Config->maxHARQ_Tx = maxHARQ_Tx;
|
||||
mac_MainConfig->ul_SCH_Config->periodicBSR_Timer = periodicBSR_Timer;
|
||||
mac_MainConfig->ul_SCH_Config->retxBSR_Timer = LTE_RetxBSR_Timer_r12_sf320;
|
||||
mac_MainConfig->ul_SCH_Config->ttiBundling = 0; // FALSE
|
||||
mac_MainConfig->timeAlignmentTimerDedicated = LTE_TimeAlignmentTimer_infinity;
|
||||
mac_MainConfig->drx_Config = NULL;
|
||||
mac_MainConfig->phr_Config = CALLOC(1, sizeof(*mac_MainConfig->phr_Config));
|
||||
mac_MainConfig->phr_Config->present = LTE_MAC_MainConfig__phr_Config_PR_setup;
|
||||
mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20; // sf20 = 20 subframes
|
||||
mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer = LTE_MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20; // sf20 = 20 subframes
|
||||
mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange = LTE_MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB3; // Value dB1 =1 dB, dB3 = 3 dB
|
||||
|
||||
|
||||
rrcConnectionSetup->rrc_TransactionIdentifier = Transaction_id;
|
||||
rrcConnectionSetup->criticalExtensions.present = LTE_RRCConnectionSetup__criticalExtensions_PR_c1;
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.present =LTE_RRCConnectionSetup__criticalExtensions__c1_PR_rrcConnectionSetup_r8 ;
|
||||
@@ -3091,7 +3112,7 @@ uint8_t do_RRCConnectionSetup_BR(
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.drb_ToReleaseList = NULL;
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.sps_Config = NULL;
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.physicalConfigDedicated = physicalConfigDedicated2;
|
||||
rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig = NULL;
|
||||
// rrcConnectionSetup->criticalExtensions.choice.c1.choice.rrcConnectionSetup_r8.radioResourceConfigDedicated.mac_MainConfig = NULL;
|
||||
|
||||
#ifdef XER_PRINT
|
||||
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
|
||||
|
||||
@@ -344,7 +344,8 @@ typedef enum HO_STATE_e {
|
||||
HO_REQUEST,
|
||||
HO_ACK,
|
||||
HO_CONFIGURED,
|
||||
HO_RELEASE
|
||||
HO_RELEASE,
|
||||
HO_CANCEL
|
||||
} HO_STATE_t;
|
||||
|
||||
typedef enum SL_TRIGGER_e {
|
||||
|
||||
+175
-879
File diff suppressed because it is too large
Load Diff
@@ -41,6 +41,7 @@
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
#include "x2ap_common.h"
|
||||
#include "x2ap_ids.h"
|
||||
#include "x2ap_timers.h"
|
||||
|
||||
#include "queue.h"
|
||||
#include "assertions.h"
|
||||
@@ -301,6 +302,9 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
|
||||
new_instance->num_cc = x2ap_register_eNB->num_cc;
|
||||
|
||||
x2ap_id_manager_init(&new_instance->id_manager);
|
||||
x2ap_timers_init(&new_instance->timers,
|
||||
x2ap_register_eNB->t_reloc_prep,
|
||||
x2ap_register_eNB->tx2_reloc_overall);
|
||||
|
||||
for (int i = 0; i< x2ap_register_eNB->num_cc; i++) {
|
||||
new_instance->eutra_band[i] = x2ap_register_eNB->eutra_band[i];
|
||||
@@ -402,6 +406,10 @@ void x2ap_eNB_handle_handover_req(instance_t instance,
|
||||
}
|
||||
/* id_source is ue_id, id_target is unknown yet */
|
||||
x2ap_set_ids(id_manager, ue_id, x2ap_handover_req->rnti, ue_id, -1);
|
||||
x2ap_id_set_state(id_manager, ue_id, X2ID_STATE_SOURCE_PREPARE);
|
||||
x2ap_set_reloc_prep_timer(id_manager, ue_id,
|
||||
x2ap_timer_get_tti(&instance_p->timers));
|
||||
x2ap_id_set_target(id_manager, ue_id, target);
|
||||
|
||||
x2ap_eNB_generate_x2_handover_request(instance_p, target, x2ap_handover_req, ue_id);
|
||||
}
|
||||
@@ -480,6 +488,10 @@ void *x2ap_task(void *arg) {
|
||||
itti_exit_task();
|
||||
break;
|
||||
|
||||
case X2AP_SUBFRAME_PROCESS:
|
||||
x2ap_check_timers(ITTI_MESSAGE_GET_INSTANCE(received_msg));
|
||||
break;
|
||||
|
||||
case X2AP_REGISTER_ENB_REQ:
|
||||
x2ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
&X2AP_REGISTER_ENB_REQ(received_msg));
|
||||
@@ -534,4 +546,38 @@ void *x2ap_task(void *arg) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
int is_x2ap_enabled(void)
|
||||
{
|
||||
static volatile int config_loaded = 0;
|
||||
static volatile int enabled = 0;
|
||||
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
if (pthread_mutex_lock(&mutex)) goto mutex_error;
|
||||
|
||||
if (config_loaded) {
|
||||
if (pthread_mutex_unlock(&mutex)) goto mutex_error;
|
||||
return enabled;
|
||||
}
|
||||
|
||||
char *enable_x2 = NULL;
|
||||
paramdef_t p[] = {
|
||||
{ "enable_x2", "yes/no", 0, strptr:&enable_x2, defstrval:"", TYPE_STRING, 0 }
|
||||
};
|
||||
|
||||
/* TODO: do it per module - we check only first eNB */
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), "eNBs.[0]");
|
||||
if (enable_x2 != NULL && strcmp(enable_x2, "yes") == 0)
|
||||
enabled = 1;
|
||||
|
||||
config_loaded = 1;
|
||||
|
||||
if (pthread_mutex_unlock(&mutex)) goto mutex_error;
|
||||
|
||||
return enabled;
|
||||
|
||||
mutex_error:
|
||||
LOG_E(X2AP, "mutex error\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ int x2ap_eNB_init_sctp (x2ap_eNB_instance_t *instance_p,
|
||||
|
||||
void *x2ap_task(void *arg);
|
||||
|
||||
int is_x2ap_enabled(void);
|
||||
|
||||
#endif /* X2AP_H_ */
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,11 +48,17 @@ static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu)
|
||||
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
|
||||
break;
|
||||
|
||||
case X2AP_ProcedureCode_id_uEContextRelease:
|
||||
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
|
||||
break;
|
||||
|
||||
case X2AP_ProcedureCode_id_handoverCancel:
|
||||
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
|
||||
(int)pdu->choice.initiatingMessage.procedureCode);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "sctp_eNB_defs.h"
|
||||
|
||||
#include "x2ap_ids.h"
|
||||
#include "x2ap_timers.h"
|
||||
|
||||
#ifndef X2AP_ENB_DEFS_H_
|
||||
#define X2AP_ENB_DEFS_H_
|
||||
@@ -63,7 +64,6 @@ typedef enum {
|
||||
X2AP_ENB_STATE_MAX,
|
||||
} x2ap_eNB_state_t;
|
||||
|
||||
|
||||
/* Served PLMN identity element */
|
||||
struct plmn_identity_s {
|
||||
uint16_t mcc;
|
||||
@@ -184,6 +184,7 @@ typedef struct x2ap_eNB_instance_s {
|
||||
int multi_sd;
|
||||
|
||||
x2ap_id_manager id_manager;
|
||||
x2ap_timers_t timers;
|
||||
} x2ap_eNB_instance_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -718,3 +718,87 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
int x2_ue_id,
|
||||
x2ap_handover_cancel_cause_t cause)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_HandoverCancel_t *out;
|
||||
X2AP_HandoverCancel_IEs_t *ie;
|
||||
int ue_id;
|
||||
int id_source;
|
||||
int id_target;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
ue_id = x2_ue_id;
|
||||
id_source = ue_id;
|
||||
id_target = x2ap_id_get_id_target(&instance_p->id_manager, ue_id);
|
||||
|
||||
/* Prepare the X2AP handover cancel message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = X2AP_ProcedureCode_id_handoverCancel;
|
||||
pdu.choice.initiatingMessage.criticality = X2AP_Criticality_ignore;
|
||||
pdu.choice.initiatingMessage.value.present = X2AP_InitiatingMessage__value_PR_HandoverCancel;
|
||||
out = &pdu.choice.initiatingMessage.value.choice.HandoverCancel;
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_HandoverCancel_IEs_t *)calloc(1, sizeof(X2AP_HandoverCancel_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = id_source;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional */
|
||||
if (id_target != -1) {
|
||||
ie = (X2AP_HandoverCancel_IEs_t *)calloc(1, sizeof(X2AP_HandoverCancel_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_HandoverCancel_IEs__value_PR_UE_X2AP_ID_1;
|
||||
ie->value.choice.UE_X2AP_ID_1 = id_target;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
}
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_HandoverCancel_IEs_t *)calloc(1, sizeof(X2AP_HandoverCancel_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_Cause;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_HandoverCancel_IEs__value_PR_Cause;
|
||||
switch (cause) {
|
||||
case X2AP_T_RELOC_PREP_TIMEOUT:
|
||||
ie->value.choice.Cause.present = X2AP_Cause_PR_radioNetwork;
|
||||
ie->value.choice.Cause.choice.radioNetwork =
|
||||
X2AP_CauseRadioNetwork_trelocprep_expiry;
|
||||
break;
|
||||
case X2AP_TX2_RELOC_OVERALL_TIMEOUT:
|
||||
ie->value.choice.Cause.present = X2AP_Cause_PR_radioNetwork;
|
||||
ie->value.choice.Cause.choice.radioNetwork =
|
||||
X2AP_CauseRadioNetwork_tx2relocoverall_expiry;
|
||||
break;
|
||||
default:
|
||||
/* we can't come here */
|
||||
X2AP_ERROR("unhandled cancel cause\n");
|
||||
exit(1);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode X2 Handover Cancel\n");
|
||||
abort();
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,10 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
|
||||
|
||||
int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
x2ap_ue_context_release_t *x2ap_ue_context_release);
|
||||
|
||||
int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
int x2_ue_id,
|
||||
x2ap_handover_cancel_cause_t cause);
|
||||
|
||||
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
|
||||
|
||||
|
||||
@@ -78,10 +78,16 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_handover_cancel (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
/* Handlers matrix. Only eNB related procedure present here */
|
||||
x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ x2ap_eNB_handle_handover_preparation, x2ap_eNB_handle_handover_response, 0 }, /* handoverPreparation */
|
||||
{ 0, 0, 0 }, /* handoverCancel */
|
||||
{ x2ap_eNB_handle_handover_cancel, 0, 0 }, /* handoverCancel */
|
||||
{ 0, 0, 0 }, /* loadIndication */
|
||||
{ 0, 0, 0 }, /* errorIndication */
|
||||
{ 0, 0, 0 }, /* snStatusTransfer */
|
||||
@@ -631,6 +637,7 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
|
||||
}
|
||||
/* rnti is unknown yet, must not be set to -1, 0 is fine */
|
||||
x2ap_set_ids(&instance_p->id_manager, ue_id, 0, ie->value.choice.UE_X2AP_ID, ue_id);
|
||||
x2ap_id_set_state(&instance_p->id_manager, ue_id, X2ID_STATE_TARGET);
|
||||
|
||||
X2AP_HANDOVER_REQ(msg).x2_id = ue_id;
|
||||
|
||||
@@ -775,15 +782,19 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
|
||||
|
||||
ue_id = id_source;
|
||||
|
||||
if (id_source != x2ap_id_get_id_source(&instance_p->id_manager, ue_id)) {
|
||||
X2AP_ERROR("incorrect X2AP IDs for UE (old ID %d new ID %d)\n", id_source, id_target);
|
||||
exit(1);
|
||||
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
|
||||
X2AP_WARN("incorrect/unknown X2AP IDs for UE (old ID %d new ID %d), ignoring handover response\n",
|
||||
id_source, id_target);
|
||||
return 0;
|
||||
}
|
||||
|
||||
rnti = x2ap_id_get_rnti(&instance_p->id_manager, ue_id);
|
||||
|
||||
/* id_target is a new information, store it */
|
||||
x2ap_set_ids(&instance_p->id_manager, ue_id, rnti, id_source, id_target);
|
||||
x2ap_id_set_state(&instance_p->id_manager, ue_id, X2ID_STATE_SOURCE_OVERALL);
|
||||
x2ap_set_reloc_overall_timer(&instance_p->id_manager, ue_id,
|
||||
x2ap_timer_get_tti(&instance_p->timers));
|
||||
|
||||
X2AP_HANDOVER_REQ_ACK(msg).rnti = rnti;
|
||||
|
||||
@@ -859,13 +870,19 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
|
||||
id_target = ie->value.choice.UE_X2AP_ID_1;
|
||||
|
||||
ue_id = id_source;
|
||||
if (ue_id != x2ap_find_id_from_id_source(&instance_p->id_manager, id_source)) {
|
||||
X2AP_WARN("incorrect/unknown X2AP IDs for UE (old ID %d new ID %d), ignoring UE context release\n",
|
||||
id_source, id_target);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (id_target != x2ap_id_get_id_target(&instance_p->id_manager, ue_id)) {
|
||||
X2AP_ERROR("UE context release: bad id_target for UE %x (id_source %d) expected %d got %d\n",
|
||||
X2AP_ERROR("UE context release: bad id_target for UE %x (id_source %d) expected %d got %d, ignoring message\n",
|
||||
x2ap_id_get_rnti(&instance_p->id_manager, ue_id),
|
||||
id_source,
|
||||
x2ap_id_get_id_target(&instance_p->id_manager, ue_id),
|
||||
id_target);
|
||||
return 0;
|
||||
}
|
||||
|
||||
X2AP_UE_CONTEXT_RELEASE(msg).rnti = x2ap_id_get_rnti(&instance_p->id_manager, ue_id);
|
||||
@@ -876,3 +893,111 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_handover_cancel (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
X2AP_HandoverCancel_t *x2HandoverCancel;
|
||||
X2AP_HandoverCancel_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
MessageDef *msg;
|
||||
int ue_id;
|
||||
int id_source;
|
||||
int id_target;
|
||||
x2ap_handover_cancel_cause_t cause;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2HandoverCancel = &pdu->choice.initiatingMessage.value.choice.HandoverCancel;
|
||||
|
||||
if (stream == 0) {
|
||||
X2AP_ERROR ("Received new x2 handover cancel on stream == 0\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
X2AP_DEBUG ("Received a new X2 handover cancel\n");
|
||||
|
||||
x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0);
|
||||
DevAssert(x2ap_eNB_data != NULL);
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverCancel_IEs_t, ie, x2HandoverCancel,
|
||||
X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID, true);
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
id_source = ie->value.choice.UE_X2AP_ID;
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverCancel_IEs_t, ie, x2HandoverCancel,
|
||||
X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID, false);
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_INFO("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
id_target = -1;
|
||||
} else
|
||||
id_target = ie->value.choice.UE_X2AP_ID_1;
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverCancel_IEs_t, ie, x2HandoverCancel,
|
||||
X2AP_ProtocolIE_ID_id_Cause, true);
|
||||
|
||||
if (ie == NULL ) {
|
||||
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ie->value.present != X2AP_HandoverCancel_IEs__value_PR_Cause ||
|
||||
ie->value.choice.Cause.present != X2AP_Cause_PR_radioNetwork ||
|
||||
!(ie->value.choice.Cause.choice.radioNetwork ==
|
||||
X2AP_CauseRadioNetwork_trelocprep_expiry ||
|
||||
ie->value.choice.Cause.choice.radioNetwork ==
|
||||
X2AP_CauseRadioNetwork_tx2relocoverall_expiry)) {
|
||||
X2AP_ERROR("%s %d: Cause not supported (only T_reloc_prep and TX2_reloc_overall handled)\n",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (ie->value.choice.Cause.choice.radioNetwork) {
|
||||
case X2AP_CauseRadioNetwork_trelocprep_expiry:
|
||||
cause = X2AP_T_RELOC_PREP_TIMEOUT;
|
||||
break;
|
||||
case X2AP_CauseRadioNetwork_tx2relocoverall_expiry:
|
||||
cause = X2AP_TX2_RELOC_OVERALL_TIMEOUT;
|
||||
break;
|
||||
default: /* can't come here */ exit(1);
|
||||
}
|
||||
|
||||
ue_id = x2ap_find_id_from_id_source(&instance_p->id_manager, id_source);
|
||||
if (ue_id == -1) {
|
||||
X2AP_WARN("Handover cancel: UE not found (id_source = %d), ignoring message\n", id_source);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (id_target != -1 &&
|
||||
id_target != x2ap_id_get_id_target(&instance_p->id_manager, ue_id)) {
|
||||
X2AP_ERROR("Handover cancel: bad id_target for UE %x (id_source %d) expected %d got %d\n",
|
||||
x2ap_id_get_rnti(&instance_p->id_manager, ue_id),
|
||||
id_source,
|
||||
x2ap_id_get_id_target(&instance_p->id_manager, ue_id),
|
||||
id_target);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
msg = itti_alloc_new_message(TASK_X2AP, X2AP_HANDOVER_CANCEL);
|
||||
|
||||
X2AP_HANDOVER_CANCEL(msg).rnti = x2ap_id_get_rnti(&instance_p->id_manager, ue_id);
|
||||
X2AP_HANDOVER_CANCEL(msg).cause = cause;
|
||||
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
|
||||
|
||||
x2ap_release_id(&instance_p->id_manager, ue_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,16 @@ int x2ap_find_id(x2ap_id_manager *m, int id_source, int id_target)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int x2ap_find_id_from_id_source(x2ap_id_manager *m, int id_source)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < X2AP_MAX_IDS; i++)
|
||||
if (m->ids[i].rnti != -1 &&
|
||||
m->ids[i].id_source == id_source)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int x2ap_find_id_from_rnti(x2ap_id_manager *m, int rnti)
|
||||
{
|
||||
int i;
|
||||
@@ -76,6 +86,27 @@ void x2ap_set_ids(x2ap_id_manager *m, int ue_id, int rnti, int id_source, int id
|
||||
m->ids[ue_id].id_target = id_target;
|
||||
}
|
||||
|
||||
/* real type of target is x2ap_eNB_data_t * */
|
||||
void x2ap_id_set_target(x2ap_id_manager *m, int ue_id, void *target)
|
||||
{
|
||||
m->ids[ue_id].target = target;
|
||||
}
|
||||
|
||||
void x2ap_id_set_state(x2ap_id_manager *m, int ue_id, x2id_state_t state)
|
||||
{
|
||||
m->ids[ue_id].state = state;
|
||||
}
|
||||
|
||||
void x2ap_set_reloc_prep_timer(x2ap_id_manager *m, int ue_id, uint64_t time)
|
||||
{
|
||||
m->ids[ue_id].t_reloc_prep_start = time;
|
||||
}
|
||||
|
||||
void x2ap_set_reloc_overall_timer(x2ap_id_manager *m, int ue_id, uint64_t time)
|
||||
{
|
||||
m->ids[ue_id].tx2_reloc_overall_start = time;
|
||||
}
|
||||
|
||||
int x2ap_id_get_id_source(x2ap_id_manager *m, int ue_id)
|
||||
{
|
||||
return m->ids[ue_id].id_source;
|
||||
@@ -90,3 +121,8 @@ int x2ap_id_get_rnti(x2ap_id_manager *m, int ue_id)
|
||||
{
|
||||
return m->ids[ue_id].rnti;
|
||||
}
|
||||
|
||||
void *x2ap_id_get_target(x2ap_id_manager *m, int ue_id)
|
||||
{
|
||||
return m->ids[ue_id].target;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,38 @@
|
||||
#ifndef X2AP_IDS_H_
|
||||
#define X2AP_IDS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* maximum number of simultaneous handovers, do not set too high */
|
||||
#define X2AP_MAX_IDS 16
|
||||
|
||||
/*
|
||||
* state:
|
||||
* - when starting handover in source, UE is in state X2ID_STATE_SOURCE_PREPARE
|
||||
* - after receiving HO_ack in source, UE is in state X2ID_STATE_SOURCE_OVERALL
|
||||
* - in target, UE is in state X2ID_STATE_TARGET
|
||||
* The state is used to check timers.
|
||||
*/
|
||||
typedef enum {
|
||||
X2ID_STATE_SOURCE_PREPARE,
|
||||
X2ID_STATE_SOURCE_OVERALL,
|
||||
X2ID_STATE_TARGET
|
||||
} x2id_state_t;
|
||||
|
||||
typedef struct {
|
||||
int rnti; /* -1 when free */
|
||||
int id_source;
|
||||
int id_target;
|
||||
int rnti; /* -1 when free */
|
||||
int id_source;
|
||||
int id_target;
|
||||
|
||||
/* the target eNB. Real type is x2ap_eNB_data_t * */
|
||||
void *target;
|
||||
|
||||
/* state: needed to check timers */
|
||||
x2id_state_t state;
|
||||
|
||||
/* timers */
|
||||
uint64_t t_reloc_prep_start;
|
||||
uint64_t tx2_reloc_overall_start;
|
||||
} x2ap_id;
|
||||
|
||||
typedef struct {
|
||||
@@ -38,10 +64,17 @@ void x2ap_id_manager_init(x2ap_id_manager *m);
|
||||
int x2ap_allocate_new_id(x2ap_id_manager *m);
|
||||
void x2ap_release_id(x2ap_id_manager *m, int id);
|
||||
int x2ap_find_id(x2ap_id_manager *, int id_source, int id_target);
|
||||
int x2ap_find_id_from_id_source(x2ap_id_manager *, int id_source);
|
||||
int x2ap_find_id_from_rnti(x2ap_id_manager *, int rnti);
|
||||
void x2ap_set_ids(x2ap_id_manager *m, int ue_id, int rnti, int id_source, int id_target);
|
||||
void x2ap_id_set_state(x2ap_id_manager *m, int ue_id, x2id_state_t state);
|
||||
/* real type of target is x2ap_eNB_data_t * */
|
||||
void x2ap_id_set_target(x2ap_id_manager *m, int ue_id, void *target);
|
||||
void x2ap_set_reloc_prep_timer(x2ap_id_manager *m, int ue_id, uint64_t time);
|
||||
void x2ap_set_reloc_overall_timer(x2ap_id_manager *m, int ue_id, uint64_t time);
|
||||
int x2ap_id_get_id_source(x2ap_id_manager *m, int ue_id);
|
||||
int x2ap_id_get_id_target(x2ap_id_manager *m, int ue_id);
|
||||
int x2ap_id_get_rnti(x2ap_id_manager *m, int ue_id);
|
||||
void *x2ap_id_get_target(x2ap_id_manager *m, int ue_id);
|
||||
|
||||
#endif /* X2AP_IDS_H_ */
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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 "x2ap_timers.h"
|
||||
#include "assertions.h"
|
||||
#include "PHY/defs_common.h" /* TODO: try to not include this */
|
||||
#include "x2ap_messages_types.h"
|
||||
#include "x2ap_eNB_defs.h"
|
||||
#include "x2ap_ids.h"
|
||||
#include "x2ap_eNB_management_procedures.h"
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
|
||||
void x2ap_timers_init(x2ap_timers_t *t, int t_reloc_prep, int tx2_reloc_overall)
|
||||
{
|
||||
t->tti = 0;
|
||||
t->t_reloc_prep = t_reloc_prep;
|
||||
t->tx2_reloc_overall = tx2_reloc_overall;
|
||||
}
|
||||
|
||||
void x2ap_check_timers(instance_t instance)
|
||||
{
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
x2ap_timers_t *t;
|
||||
x2ap_id_manager *m;
|
||||
int i;
|
||||
x2ap_handover_cancel_cause_t cause;
|
||||
void *target;
|
||||
MessageDef *msg;
|
||||
int x2_ongoing;
|
||||
|
||||
instance_p = x2ap_eNB_get_instance(instance);
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
t = &instance_p->timers;
|
||||
m = &instance_p->id_manager;
|
||||
|
||||
/* increment subframe count */
|
||||
t->tti++;
|
||||
|
||||
x2_ongoing = 0;
|
||||
|
||||
for (i = 0; i < X2AP_MAX_IDS; i++) {
|
||||
if (m->ids[i].rnti == -1) continue;
|
||||
x2_ongoing++;
|
||||
|
||||
if (m->ids[i].state == X2ID_STATE_SOURCE_PREPARE &&
|
||||
t->tti > m->ids[i].t_reloc_prep_start + t->t_reloc_prep) {
|
||||
LOG_I(X2AP, "X2 timeout reloc prep\n");
|
||||
/* t_reloc_prep timed out */
|
||||
cause = X2AP_T_RELOC_PREP_TIMEOUT;
|
||||
goto timeout;
|
||||
}
|
||||
|
||||
if (m->ids[i].state == X2ID_STATE_SOURCE_OVERALL &&
|
||||
t->tti > m->ids[i].tx2_reloc_overall_start + t->tx2_reloc_overall) {
|
||||
LOG_I(X2AP, "X2 timeout reloc overall\n");
|
||||
/* tx2_reloc_overall timed out */
|
||||
cause = X2AP_TX2_RELOC_OVERALL_TIMEOUT;
|
||||
goto timeout;
|
||||
}
|
||||
|
||||
/* no timeout -> check next UE */
|
||||
continue;
|
||||
|
||||
timeout:
|
||||
/* inform target about timeout */
|
||||
target = x2ap_id_get_target(m, i);
|
||||
x2ap_eNB_generate_x2_handover_cancel(instance_p, target, i, cause);
|
||||
|
||||
/* inform RRC of cancellation */
|
||||
msg = itti_alloc_new_message(TASK_X2AP, X2AP_HANDOVER_CANCEL);
|
||||
X2AP_HANDOVER_CANCEL(msg).rnti = x2ap_id_get_rnti(m, i);
|
||||
X2AP_HANDOVER_CANCEL(msg).cause = cause;
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
|
||||
|
||||
/* remove UE from X2AP */
|
||||
x2ap_release_id(m, i);
|
||||
}
|
||||
|
||||
if (x2_ongoing && t->tti % 1000 == 0)
|
||||
LOG_I(X2AP, "X2 has %d process ongoing\n", x2_ongoing);
|
||||
}
|
||||
|
||||
uint64_t x2ap_timer_get_tti(x2ap_timers_t *t)
|
||||
{
|
||||
return t->tti;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 X2AP_TIMERS_H_
|
||||
#define X2AP_TIMERS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "platform_types.h"
|
||||
|
||||
typedef struct {
|
||||
/* incremented every TTI (every millisecond when in realtime).
|
||||
* Used to check timers.
|
||||
* 64 bits gives us more than 500 million years of (realtime) processing.
|
||||
* It should be enough.
|
||||
*/
|
||||
uint64_t tti;
|
||||
|
||||
/* timer values (unit: TTI, ie. millisecond when in realtime) */
|
||||
int t_reloc_prep;
|
||||
int tx2_reloc_overall;
|
||||
} x2ap_timers_t;
|
||||
|
||||
void x2ap_timers_init(x2ap_timers_t *t, int t_reloc_prep, int tx2_reloc_overall);
|
||||
void x2ap_check_timers(instance_t instance);
|
||||
uint64_t x2ap_timer_get_tti(x2ap_timers_t *t);
|
||||
|
||||
#endif /* X2AP_TIMERS_H_ */
|
||||
@@ -53,10 +53,13 @@ int create_tasks(uint32_t enb_nb) {
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
if (enb_nb > 0) {
|
||||
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
|
||||
LOG_E(X2AP, "Create task for X2AP failed\n");
|
||||
return -1;
|
||||
}
|
||||
if (is_x2ap_enabled()) {
|
||||
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
|
||||
LOG_E(X2AP, "Create task for X2AP failed\n");
|
||||
return -1;
|
||||
}
|
||||
} else
|
||||
LOG_I(X2AP, "X2AP is disabled.\n");
|
||||
|
||||
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
|
||||
@@ -37,6 +37,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -49,6 +49,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -36,6 +36,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth1";
|
||||
|
||||
@@ -48,9 +48,9 @@ eNBs =
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 1;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
@@ -262,7 +262,7 @@ eNBs =
|
||||
n1PUCCH_AN_InfoList_r13 =
|
||||
(
|
||||
{
|
||||
pucch_info_value = 0;
|
||||
pucch_info_value = 33;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -360,6 +360,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
|
||||
@@ -142,6 +142,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eno1";
|
||||
|
||||
@@ -142,6 +142,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eno1";
|
||||
|
||||
@@ -145,6 +145,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth6";
|
||||
|
||||
@@ -178,6 +178,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
|
||||
@@ -179,6 +179,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
|
||||
@@ -179,6 +179,11 @@ eNBs =
|
||||
}
|
||||
);
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user