Merge branch 'develop' into feature-127-protocol-split
This commit is contained in:
@@ -272,7 +272,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
echo "Red Hat build failed not an error now"
|
||||
echo "Red Hat build failed but we could keep running pipeline if all ubuntu-based build passed"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,6 +290,17 @@ pipeline {
|
||||
}
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
sh "./ci-scripts/oai-ci-vm-tool report-build --workspace $WORKSPACE --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
// If the merge request has introduced more CPPCHECK errors or warnings, notifications in GitLab
|
||||
if (fileExists('oai_cppcheck_added_errors.txt')) {
|
||||
def ret=readFile('./oai_cppcheck_added_errors.txt').trim();
|
||||
if ("0".equals(ret)) {
|
||||
echo "No added cppcheck warnings/errors in this merge request"
|
||||
} else {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some modified files in Merge Request MAY have INTRODUCED up to " + ret + " CPPCHECK errors/warnings"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
}
|
||||
// If the merge request has introduced compilation warnings, notifications in GitLab
|
||||
sh "./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
|
||||
def res=readFile('./oai_warning_files.txt').trim();
|
||||
if ("0".equals(res)) {
|
||||
@@ -313,40 +324,68 @@ pipeline {
|
||||
|
||||
stage ("Variant Tests") {
|
||||
parallel {
|
||||
stage ("Test physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Test phy-sim") {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
stage ("VM-based tests") {
|
||||
stages {
|
||||
stage ("Test physical simulators") {
|
||||
steps {
|
||||
script {
|
||||
gitlabCommitStatus(name: "Test phy-sim") {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
try {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test basic simulator") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Test basic-sim") {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
stage ("Build Flexran Controller") {
|
||||
when {
|
||||
expression {doFlexranCtrlTest}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
try {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test L2 simulator") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Test L2-sim") {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
stage ("Test basic simulator") {
|
||||
steps {
|
||||
script {
|
||||
gitlabCommitStatus(name: "Test basic-sim") {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build Flexran Controller") {
|
||||
when {
|
||||
expression {doFlexranCtrlTest}
|
||||
}
|
||||
steps {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
stage ("Test L2 simulator") {
|
||||
steps {
|
||||
script {
|
||||
gitlabCommitStatus(name: "Test L2-sim") {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant l2-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +399,8 @@ pipeline {
|
||||
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)
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true),
|
||||
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
|
||||
]
|
||||
}
|
||||
} else {
|
||||
@@ -405,7 +445,8 @@ pipeline {
|
||||
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)
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true),
|
||||
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
|
||||
]
|
||||
}
|
||||
} else {
|
||||
@@ -450,7 +491,8 @@ pipeline {
|
||||
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)
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true),
|
||||
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
|
||||
]
|
||||
}
|
||||
} else {
|
||||
@@ -495,7 +537,8 @@ pipeline {
|
||||
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)
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true),
|
||||
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
|
||||
]
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -115,8 +115,10 @@ pipeline {
|
||||
} else {
|
||||
String[] myXmlTestSuite = testXMLFile.split("\\r?\\n")
|
||||
for (xmlFile in myXmlTestSuite) {
|
||||
mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " "
|
||||
echo "Test XML file : ${xmlFile}"
|
||||
if (fileExists("ci-scripts/" + xmlFile)) {
|
||||
mainPythonAllXmlFiles += "--XMLTestFile=" + xmlFile + " "
|
||||
echo "Test XML file : ${xmlFile}"
|
||||
}
|
||||
}
|
||||
}
|
||||
// If not present picking a default Stage Name
|
||||
@@ -191,6 +193,13 @@ pipeline {
|
||||
|
||||
if (allParametersPresent) {
|
||||
echo "All parameters are present"
|
||||
if (eNB_AllowMergeRequestProcess) {
|
||||
sh "git fetch"
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${eNB_Branch} --src-commit ${eNB_CommitID} --target-branch ${eNB_TargetBranch} --target-commit latest"
|
||||
} else {
|
||||
sh "git fetch"
|
||||
sh "git checkout -f ${eNB_CommitID}"
|
||||
}
|
||||
} else {
|
||||
echo "Some parameters are missing"
|
||||
sh "./ci-scripts/fail.sh"
|
||||
@@ -211,6 +220,7 @@ pipeline {
|
||||
sh "python3 main.py --mode=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} ${mainPythonAllXmlFiles}"
|
||||
String[] myXmlTestSuite = testXMLFile.split("\\r?\\n")
|
||||
for (xmlFile in myXmlTestSuite) {
|
||||
if (fileExists(xmlFile)) {
|
||||
try {
|
||||
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${xmlFile}"
|
||||
} catch (Exception e) {
|
||||
@@ -218,6 +228,7 @@ pipeline {
|
||||
buildStageStatus = false
|
||||
}
|
||||
}
|
||||
}
|
||||
sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ fi
|
||||
|
||||
# Merge request scenario
|
||||
|
||||
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
|
||||
MERGE_COMMMIT=`git log -n1 --pretty=format:%H`
|
||||
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
|
||||
|
||||
echo " ---- Checking the modified files by the merge request ----"
|
||||
|
||||
@@ -111,7 +111,7 @@ fi
|
||||
|
||||
# Merge request scenario
|
||||
|
||||
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
|
||||
MERGE_COMMMIT=`git log -n1 --pretty=format:%H`
|
||||
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
|
||||
|
||||
echo " ---- Checking the modified files by the merge request ----"
|
||||
|
||||
@@ -103,6 +103,11 @@ esac
|
||||
|
||||
done
|
||||
|
||||
if [[ $TARGET_COMMIT_ID == "latest" ]]
|
||||
then
|
||||
TARGET_COMMIT_ID=`git log -n1 --pretty=format:%H origin/$TARGET_BRANCH`
|
||||
fi
|
||||
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Source Commit ID is : $SOURCE_COMMIT_ID"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
|
||||
@@ -218,6 +218,22 @@ function sca_summary_table_header {
|
||||
echo " <h3>$2</h3>" >> ./build_results.html
|
||||
NB_ERRORS=`egrep -c "severity=\"error\"" $1`
|
||||
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
|
||||
ADDED_ERRORS="0"
|
||||
ADDED_WARNINGS="0"
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ -d ../../cppcheck_archives ]
|
||||
then
|
||||
if [ -d ../../cppcheck_archives/$JOB_NAME ]
|
||||
then
|
||||
ADDED_ERRORS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"error"`
|
||||
ADDED_WARNINGS=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep -c "severity=\"warning"`
|
||||
fi
|
||||
fi
|
||||
local TOTAL_NUMBER=$[$ADDED_ERRORS+$ADDED_WARNINGS]
|
||||
if [ -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt ]; then rm -f $JENKINS_WKSP/oai_cppcheck_added_errors.txt; fi
|
||||
echo "$TOTAL_NUMBER" > $JENKINS_WKSP/oai_cppcheck_added_errors.txt
|
||||
fi
|
||||
if [ $NB_ERRORS -eq 0 ] && [ $NB_WARNINGS -eq 0 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./build_results.html
|
||||
@@ -227,16 +243,54 @@ function sca_summary_table_header {
|
||||
if [ $NB_ERRORS -eq 0 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
|
||||
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
|
||||
fi
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $ADDED_WARNINGS -eq 0 ]
|
||||
then
|
||||
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
|
||||
else
|
||||
echo " <strong>CPPCHECK found NO error and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
|
||||
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
|
||||
fi
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $ADDED_ERRORS -eq 0 ] && [ $ADDED_WARNINGS -eq 0 ]
|
||||
then
|
||||
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./build_results.html
|
||||
else
|
||||
echo " <strong>CPPCHECK found $NB_ERRORS errors and $NB_WARNINGS warnings <span class=\"glyphicon glyphicon-ban-circle\"></span>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
echo " <span class=\"glyphicon glyphicon-alert\"></span> This Merge Request may have introduced up to $ADDED_ERRORS errors and $ADDED_WARNINGS warnings. <span class=\"glyphicon glyphicon-alert\"></span></strong>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
if [ -d ../../cppcheck_archives ]
|
||||
then
|
||||
if [ -d ../../cppcheck_archives/$JOB_NAME ]
|
||||
then
|
||||
cp $1 ../../cppcheck_archives/$JOB_NAME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-cppcheck-details\">More details on CPPCHECK results</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-cppcheck-details\" class=\"collapse\">" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Error / Warning Type</th>" >> ./build_results.html
|
||||
@@ -301,6 +355,43 @@ function sca_summary_table_footer {
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
|
||||
echo " <p style=\"margin-left: 30px\">Graphical Interface tool : <strong><code>cppcheck-gui -l cppcheck/cppcheck.xml</code></strong></p>" >> ./build_results.html
|
||||
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $ADDED_ERRORS -ne 0 ] || [ $ADDED_WARNINGS -ne 0 ]
|
||||
then
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Potential File(s) impacted by added errors/warnings</th>" >> ./build_results.html
|
||||
echo " <th>Line Number</th>" >> ./build_results.html
|
||||
echo " <th>Severity</th>" >> ./build_results.html
|
||||
echo " <th>Message</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
SEVERITY="none"
|
||||
POTENTIAL_FILES=`diff $1 ../../cppcheck_archives/$JOB_NAME/cppcheck.xml | egrep --color=never "^<" | egrep "location file|severity" | sed -e "s# #@#g"`
|
||||
for POT_FILE in $POTENTIAL_FILES
|
||||
do
|
||||
if [ `echo $POT_FILE | grep -c location` -eq 1 ]
|
||||
then
|
||||
FILENAME=`echo $POT_FILE | sed -e "s#^.*file=\"##" -e "s#\"@line.*/>##"`
|
||||
LINE=`echo $POT_FILE | sed -e "s#^.*line=\"##" -e "s#\"/>##"`
|
||||
if [[ $SEVERITY != *"none" ]]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td>$FILENAME</td>" >> ./build_results.html
|
||||
echo " <td>$LINE</td>" >> ./build_results.html
|
||||
echo " <td>$SEVERITY</td>" >> ./build_results.html
|
||||
echo " <td>$MESSAGE</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
fi
|
||||
else
|
||||
SEVERITY=`echo $POT_FILE | sed -e "s#^.*severity=\"##" -e "s#\"@msg=.*##"`
|
||||
MESSAGE=`echo $POT_FILE | sed -e "s#^.*msg=\"##" -e "s#\"@verbose=.*##" -e "s#@# #g"`
|
||||
fi
|
||||
done
|
||||
echo " </table>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
}
|
||||
|
||||
@@ -407,7 +498,7 @@ function report_build {
|
||||
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
|
||||
NB_FILES=`cat ./oai_rules_result.txt`
|
||||
if [ $NB_FILES = "0" ]
|
||||
then
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>All files in repository follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>All modified files in Merge-Request follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
|
||||
@@ -522,41 +613,61 @@ function report_build {
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-compilation-details\">Details for Compilation Errors and Warnings </button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-compilation-details\" class=\"collapse\">" >> ./build_results.html
|
||||
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./basic_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./phy_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
|
||||
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./nrue_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./enb_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./ue_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
if [ -e ./archives/red_hat ]
|
||||
if [ -f ./enb_usrp_row1.html ] || [ -f ./enb_usrp_row2.html ] || [ -f ./enb_usrp_row3.html ] || [ -f ./enb_usrp_row4.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./basic_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./phy_sim_row1.html ] || [ -f ./phy_sim_row2.html ] || [ -f ./phy_sim_row3.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./phy_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./nrue_usrp_row1.html ] || [ -f ./nrue_usrp_row2.html ] || [ -f ./nrue_usrp_row3.html ] || [ -f ./nrue_usrp_row4.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./nrue_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./enb_eth_row1.html ] || [ -f ./enb_eth_row2.html ] || [ -f ./enb_eth_row3.html ] || [ -f ./enb_eth_row4.html ] || [ -f ./enb_eth_row5.html ] || [ -f ./enb_eth_row6.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./enb_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./ue_eth_row1.html ] || [ -f ./ue_eth_row2.html ] || [ -f ./ue_eth_row3.html ] || [ -f ./ue_eth_row4.html ] || [ -f ./ue_eth_row5.html ] || [ -f ./ue_eth_row6.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./ue_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./enb_usrp_rh_row1.html ] || [ -f ./enb_usrp_rh_row2.html ] || [ -f ./enb_usrp_rh_row3.html ] || [ -f ./enb_usrp_rh_row4.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
rm -f ./*_row*.html
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ function start_basic_sim_ue {
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "ifconfig oip1 | egrep -c \"inet addr\"" > $1
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
@@ -134,7 +134,7 @@ function start_basic_sim_ue {
|
||||
}
|
||||
|
||||
function get_ue_ip_addr {
|
||||
echo "ifconfig oip1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
|
||||
echo "ifconfig oaitun_ue1 | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
|
||||
UE_IP_ADDR=`ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1`
|
||||
echo "UE IP Address for EPC is : $UE_IP_ADDR"
|
||||
rm $1
|
||||
@@ -149,9 +149,9 @@ function ping_ue_ip_addr {
|
||||
}
|
||||
|
||||
function ping_epc_ip_addr {
|
||||
echo "echo \"COMMAND IS: ping -I oip1 -c 20 $3\" > $4" > $1
|
||||
echo "echo \"COMMAND IS: ping -I oaitun_ue1 -c 20 $3\" > $4" > $1
|
||||
echo "rm -f $4" >> $1
|
||||
echo "ping -I oip1 -c 20 $3 | tee -a $4" >> $1
|
||||
echo "ping -I oaitun_ue1 -c 20 $3 | tee -a $4" >> $1
|
||||
cat $1
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm -f $1
|
||||
@@ -345,7 +345,7 @@ function install_epc_on_vm {
|
||||
if [ $LTEBOX -eq 1 ] && [ $LTE_BOX_TO_INSTALL -eq 1 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Copying ltebox archives into EPC VM ($LOC_EPC_VM_NAME)"
|
||||
echo "Copying ltebox archives into EPC VM ($LOC_EPC_VM_NAME)"
|
||||
echo "############################################################"
|
||||
scp -o StrictHostKeyChecking=no /opt/ltebox-archives/ltebox_2.2.70_16_04_amd64.deb ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
|
||||
scp -o StrictHostKeyChecking=no /opt/ltebox-archives/etc-conf.zip ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
|
||||
@@ -618,9 +618,9 @@ function start_l2_sim_ue {
|
||||
UE_SYNC=1
|
||||
echo "L2-SIM UE is sync'ed w/ eNB"
|
||||
fi
|
||||
# Checking oip1 interface has now an IP address
|
||||
# Checking oaitun_ue1 interface has now an IP address
|
||||
i="0"
|
||||
echo "ifconfig oip1 | egrep -c \"inet addr\"" > $1
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
@@ -636,10 +636,10 @@ function start_l2_sim_ue {
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
UE_SYNC=0
|
||||
echo "L2-SIM UE oip1 is NOT sync'ed w/ EPC"
|
||||
echo "L2-SIM UE oaitun_ue1 is NOT sync'ed w/ EPC"
|
||||
else
|
||||
UE_SYNC=1
|
||||
echo "L2-SIM UE oip1 is sync'ed w/ EPC"
|
||||
echo "L2-SIM UE oaitun_ue1 is sync'ed w/ EPC"
|
||||
fi
|
||||
sleep 10
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
|
||||
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
|
||||
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
|
||||
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
|
||||
add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
|
||||
#add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
|
||||
add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise")
|
||||
|
||||
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
|
||||
@@ -637,7 +637,6 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
|
||||
##############################################################
|
||||
# ???!!! TO BE DOCUMENTED OPTIONS !!!???
|
||||
##############################################################
|
||||
add_boolean_option(ENABLE_SECURITY True "Enable LTE integrity and ciphering between RRC UE and eNB")
|
||||
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
|
||||
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
|
||||
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
|
||||
@@ -740,10 +739,10 @@ add_boolean_option(TRACE_RLC_UM_TX_STATUS False "TRACE for RLC UM, TO BE CHANGE
|
||||
##########################
|
||||
# PDCP LAYER OPTIONS
|
||||
##########################
|
||||
add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
|
||||
add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
|
||||
add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
|
||||
add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
|
||||
#add_boolean_option(PDCP_USE_NETLINK False "For eNB, PDCP communicate with a NETLINK socket if connected to network driver, else could use a RT-FIFO")
|
||||
#add_boolean_option(PDCP_USE_NETLINK_QUEUES False "When PDCP_USE_NETLINK is true, incoming IP packets are stored in queues")
|
||||
#add_boolean_option(LINK_ENB_PDCP_TO_IP_DRIVER False "For eNB, PDCP communicate with a IP driver")
|
||||
#add_boolean_option(LINK_ENB_PDCP_TO_GTPV1U True "For eNB, PDCP communicate with GTP-U protocol (eNB<->S-GW)")
|
||||
|
||||
##########################
|
||||
# RRC LAYER OPTIONS
|
||||
@@ -2131,26 +2130,29 @@ add_executable(lte-softmodem-nos1
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
|
||||
add_dependencies(lte-softmodem-nos1 rrc_flag s1ap_flag x2_flag)
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB F1AP F1AP_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
|
||||
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB} LFDS7
|
||||
RRC_LIB F1AP F1AP_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${PROTO_AGENT_LIB} LFDS7
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl )
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
|
||||
|
||||
# lte-uesoftmodem is UE implementation
|
||||
#######################################
|
||||
|
||||
@@ -2164,6 +2166,8 @@ add_executable(lte-uesoftmodem
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
|
||||
@@ -2207,6 +2211,7 @@ add_executable(lte-uesoftmodem-nos1
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
|
||||
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${XFORMS_SOURCE}
|
||||
@@ -2217,18 +2222,18 @@ add_executable(lte-uesoftmodem-nos1
|
||||
)
|
||||
|
||||
add_dependencies(lte-uesoftmodem-nos1 rrc_flag s1ap_flag x2_flag)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem-nos1
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB F1AP_LIB F1AP GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${RAL_LIB} ${ITTI_LIB}
|
||||
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl )
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
|
||||
|
||||
# USIM process
|
||||
#################
|
||||
#add_executable(usim
|
||||
|
||||
@@ -551,9 +551,9 @@ function main() {
|
||||
mkdir -p $DIR/$lte_build_dir/build
|
||||
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
|
||||
fi
|
||||
# if [ "$NOS1" = "1" ] ; then
|
||||
# cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
|
||||
# fi
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
@@ -944,7 +944,7 @@ fi
|
||||
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
|
||||
echo "set (UETARGET True )" >> $cmake_file
|
||||
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
|
||||
echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
|
||||
# echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
|
||||
|
||||
echo_info "Build UE"
|
||||
|
||||
@@ -9,7 +9,6 @@ set ( EMIT_ASN_DEBUG False )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME True )
|
||||
|
||||
@@ -8,7 +8,6 @@ set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME True )
|
||||
|
||||
@@ -8,7 +8,6 @@ set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST False )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False )
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME False )
|
||||
set ( ENABLE_USE_MME False )
|
||||
|
||||
@@ -7,7 +7,6 @@ set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME False )
|
||||
|
||||
@@ -9,7 +9,6 @@ set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PDCP_NETLINK_FIFO False )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
set ( ENABLE_USE_MME True )
|
||||
|
||||
+13
-6
@@ -303,8 +303,8 @@ void log_getconfig(log_t *g_log) {
|
||||
logparams_dump[i].numelt = 0;
|
||||
}
|
||||
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
|
||||
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
|
||||
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
@@ -385,7 +385,6 @@ int logInit (void) {
|
||||
register_log_component("OCG","",OCG);
|
||||
register_log_component("PERF","",PERF);
|
||||
register_log_component("OIP","",OIP);
|
||||
register_log_component("CLI","",CLI);
|
||||
register_log_component("MSC","log",MSC);
|
||||
register_log_component("OCM","log",OCM);
|
||||
register_log_component("HW","",HW);
|
||||
@@ -411,6 +410,8 @@ int logInit (void) {
|
||||
register_log_component("X2AP","",X2AP);
|
||||
register_log_component("LOADER","log",LOADER);
|
||||
register_log_component("ASN","log",ASN);
|
||||
register_log_component("NFAPI_PNF","log",NFAPI_PNF);
|
||||
register_log_component("NFAPI_VNF","log",NFAPI_VNF);
|
||||
|
||||
for (int i=0 ; log_level_names[i].name != NULL ; i++)
|
||||
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
|
||||
@@ -441,7 +442,7 @@ char *log_getthreadname(char *threadname, int bufsize) {
|
||||
|
||||
static int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
|
||||
char threadname[PR_SET_NAME];
|
||||
return snprintf(log_buffer, buffsize , "%s%s[%s]%c %s %s%s",
|
||||
return snprintf(log_buffer, buffsize, "%s%s[%s]%c %s %s%s",
|
||||
log_level_highlight_end[level],
|
||||
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
|
||||
g_log->log_component[comp].name,
|
||||
@@ -455,11 +456,17 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, int le
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
log_header(log_buffer,MAX_LOG_TOTAL ,comp, level,format);
|
||||
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
|
||||
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args ) {
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
log_header(log_buffer,MAX_LOG_TOTAL,comp, level,format);
|
||||
g_log->log_component[comp].vprint(g_log->log_component[comp].stream,log_buffer, args);
|
||||
}
|
||||
|
||||
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... ) {
|
||||
va_list args;
|
||||
char *wbuf;
|
||||
@@ -477,7 +484,7 @@ void log_dump(int component, void *buffer, int buffsize,int datatype, const char
|
||||
|
||||
if (wbuf != NULL) {
|
||||
va_start(args, format);
|
||||
int pos=log_header(wbuf,MAX_LOG_TOTAL ,component, OAILOG_INFO,"");
|
||||
int pos=log_header(wbuf,MAX_LOG_TOTAL,component, OAILOG_INFO,"");
|
||||
int pos2=vsprintf(wbuf+pos,format, args);
|
||||
pos=pos+pos2;
|
||||
va_end(args);
|
||||
|
||||
@@ -198,7 +198,6 @@ typedef enum {
|
||||
NAS,
|
||||
PERF,
|
||||
OIP,
|
||||
CLI,
|
||||
MSC,
|
||||
OCM,
|
||||
UDP_,
|
||||
@@ -221,6 +220,8 @@ typedef enum {
|
||||
X2AP,
|
||||
LOADER,
|
||||
ASN,
|
||||
NFAPI_VNF,
|
||||
NFAPI_PNF,
|
||||
MAX_LOG_PREDEF_COMPONENTS,
|
||||
}
|
||||
comp_name_t;
|
||||
@@ -289,6 +290,7 @@ extern "C" {
|
||||
int logInit (void);
|
||||
int isLogInitDone (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
|
||||
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
|
||||
int set_log(int component, int level);
|
||||
void set_glog(int level);
|
||||
@@ -368,9 +370,9 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
|
||||
# define VLOG(c,l, f, args) do { if (T_stdout) { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ;} } while (0)
|
||||
/* macro used to dump a buffer or a message as in openair2/RRC/LTE/RRC_eNB.c, replaces LOG_F macro */
|
||||
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
|
||||
/* bitmask dependant macros, to isolate debugging code */
|
||||
# define LOG_DEBUGFLAG(D) (g_log->debug_mask & D)
|
||||
|
||||
|
||||
@@ -800,6 +800,47 @@ ID = LEGACY_SIM_TRACE
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NFAPI_VNF_INFO
|
||||
DESC = NFAPI_VNF legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_VNF_ERROR
|
||||
DESC = NFAPI_VNF legacy logs - error level
|
||||
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_VNF_WARNING
|
||||
DESC = NFAPI_VNF legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_VNF_DEBUG
|
||||
DESC = NFAPI_VNF legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_VNF_TRACE
|
||||
DESC = NFAPI_VNF legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_NFAPI_VNF:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_NFAPI_PNF_INFO
|
||||
DESC = NFAPI_PNF legacy logs - info level
|
||||
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_PNF_ERROR
|
||||
DESC = NFAPI_PNF legacy logs - error level
|
||||
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_PNF_WARNING
|
||||
DESC = NFAPI_PNF legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_PNF_DEBUG
|
||||
DESC = NFAPI_PNF legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_NFAPI_PNF_TRACE
|
||||
DESC = NFAPI_PNF legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_NFAPI_PNF:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
# this is a bad hack but I won't fix (function util_print_hex_octets
|
||||
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
|
||||
# does funky things with the LOG_x macros but we work on the C pre-processor
|
||||
@@ -845,27 +886,7 @@ ID = LEGACY_componentP_TRACE
|
||||
GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
#needed?
|
||||
ID = LEGACY_CLI_INFO
|
||||
DESC = CLI legacy logs - info level
|
||||
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_CLI_ERROR
|
||||
DESC = CLI legacy logs - error level
|
||||
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_CLI_WARNING
|
||||
DESC = CLI legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_CLI_DEBUG
|
||||
DESC = CLI legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_CLI_TRACE
|
||||
DESC = CLI legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
|
||||
ID = LEGACY_PROTO_AGENT_DEBUG
|
||||
DESC = PROTO AGENT DEBUG LEVEL
|
||||
|
||||
@@ -3,7 +3,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I..
|
||||
|
||||
LIBS=-lX11 -lm -lpng -lXft
|
||||
|
||||
all: dump_nack_signal time_meas timeplot
|
||||
all: dump_nack_signal time_meas timeplot multi-rru-clean
|
||||
|
||||
dump_nack_signal: ../utils.o ../database.o ../config.o ../event.o \
|
||||
dump_nack_signal.o
|
||||
@@ -16,6 +16,9 @@ time_meas: ../utils.o ../database.o ../config.o ../event.o \
|
||||
timplot: timeplot.o
|
||||
$(CC) $(CFLAGS) -o timeplot $^ $(LIBS)
|
||||
|
||||
multi-rru-clean: ../utils.o ../database.o ../event.o ../config.o multi-rru-clean.o
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
.PHONY: all
|
||||
|
||||
%.o: %.c
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "database.h"
|
||||
#include "utils.h"
|
||||
#include "event.h"
|
||||
#include "../T_defs.h"
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"usage: <number of tags> <input record file> <output curated record file>\n"
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
#define ERR printf("ERROR: read file %s failed\n", input_filename)
|
||||
|
||||
typedef struct {
|
||||
OBUF b;
|
||||
struct timespec t;
|
||||
int filled;
|
||||
int error;
|
||||
} cache_t;
|
||||
|
||||
void clear_cache(int n, cache_t *c)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; i++) {
|
||||
c[i].filled = 0;
|
||||
c[i].error = 0;
|
||||
c[i].b.osize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void store_in_cache(cache_t *c, int pos, OBUF *b)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < b->osize; i++)
|
||||
PUTC(&c[pos].b, b->obuf[i]);
|
||||
}
|
||||
|
||||
int get_field(database_event_format *f, char *field, char *type)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < f->count; i++)
|
||||
if (!strcmp(f->name[i], field)) {
|
||||
if (strcmp(f->type[i], type)) break;
|
||||
return i;
|
||||
}
|
||||
printf("bad field %s, check that it exists and has type '%s'\n",field,type);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void process_cache(FILE *out, cache_t *c, int n, int frame, int subframe)
|
||||
{
|
||||
int i;
|
||||
struct tm *t;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (c[i].filled == 0 || c[i].error == 1)
|
||||
goto error;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
fwrite(c[i].b.obuf, c[i].b.osize, 1, out);
|
||||
|
||||
clear_cache(n, c);
|
||||
return;
|
||||
|
||||
error:
|
||||
printf("ERROR: incorrect data at frame %d subframe %d", frame, subframe);
|
||||
for (i = 0; i < n; i++) if (c[i].filled) {
|
||||
t = localtime(&c[i].t.tv_sec);
|
||||
printf(" [tag %d time %2.2d:%2.2d:%2.2d.%9.9ld]", i,
|
||||
t->tm_hour, t->tm_min, t->tm_sec, c[i].t.tv_nsec);
|
||||
}
|
||||
printf("\n");
|
||||
clear_cache(n, c);
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *database_filename = NULL;
|
||||
void *database;
|
||||
int channel_estimate_id;
|
||||
int number_of_tags = -1;
|
||||
char *input_filename = NULL;
|
||||
char *output_filename = NULL;
|
||||
int i;
|
||||
FILE *in;
|
||||
FILE *out;
|
||||
database_event_format f;
|
||||
int frame_arg;
|
||||
int subframe_arg;
|
||||
int tag_arg;
|
||||
|
||||
cache_t *cache;
|
||||
int cur_frame = -1;
|
||||
int cur_subframe = -1;
|
||||
int frame;
|
||||
int subframe;
|
||||
int tag;
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d")) { if (i > n-2) usage();
|
||||
database_filename = v[++i]; continue; }
|
||||
if (number_of_tags == -1) { number_of_tags = atoi(v[i]);
|
||||
if (number_of_tags <= 0) {usage();} continue; }
|
||||
if (input_filename == NULL) { input_filename = v[i]; continue; }
|
||||
if (output_filename == NULL) { output_filename = v[i]; continue; }
|
||||
usage();
|
||||
}
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (output_filename == NULL || input_filename == NULL || number_of_tags == -1)
|
||||
usage();
|
||||
|
||||
database = parse_database(database_filename);
|
||||
|
||||
channel_estimate_id = event_id_from_name(database, "CALIBRATION_CHANNEL_ESTIMATES");
|
||||
f = get_format(database, channel_estimate_id);
|
||||
|
||||
frame_arg = get_field(&f, "frame", "int");
|
||||
subframe_arg = get_field(&f, "subframe", "int");
|
||||
tag_arg = get_field(&f, "tag", "int");
|
||||
|
||||
in = fopen(input_filename, "r");
|
||||
if (in == NULL) { perror(input_filename); abort(); }
|
||||
out = fopen(output_filename, "w");
|
||||
if (out == NULL) { perror(output_filename); abort(); }
|
||||
|
||||
cache = calloc(number_of_tags, sizeof(cache_t));
|
||||
if (cache == NULL) { perror("malloc"); exit(1); }
|
||||
|
||||
clear_cache(number_of_tags, cache);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
int type;
|
||||
int32_t length;
|
||||
char *v;
|
||||
int vpos = 0;
|
||||
struct timespec t;
|
||||
char *buf;
|
||||
|
||||
/* read event from file */
|
||||
if (fread(&length, 4, 1, in) != 1) break;
|
||||
if (ebuf.omaxsize < length) {
|
||||
ebuf.omaxsize = (length + 65535) & ~65535;
|
||||
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
|
||||
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
|
||||
}
|
||||
v = ebuf.obuf;
|
||||
memcpy(v+vpos, &length, 4);
|
||||
vpos += 4;
|
||||
#ifdef T_SEND_TIME
|
||||
if (length < sizeof(struct timespec)) { ERR; break; }
|
||||
if (fread(&t, sizeof(struct timespec), 1, in) != 1) { ERR; break; }
|
||||
memcpy(v+vpos, &t, sizeof(struct timespec));
|
||||
vpos += sizeof(struct timespec);
|
||||
length -= sizeof(struct timespec);
|
||||
#endif
|
||||
if (length < sizeof(int)) { ERR; break; }
|
||||
if (fread(&type, sizeof(int), 1, in) != 1) { ERR; break; }
|
||||
memcpy(v+vpos, &type, sizeof(int));
|
||||
vpos += sizeof(int);
|
||||
length -= sizeof(int);
|
||||
if (length) if (fread(v+vpos, length, 1, in) != 1) { ERR; break; }
|
||||
buf = v + vpos;
|
||||
vpos += length;
|
||||
ebuf.osize = vpos;
|
||||
|
||||
if (type != channel_estimate_id) continue;
|
||||
|
||||
event e;
|
||||
#ifdef T_SEND_TIME
|
||||
e = new_event(t, type, length, buf, database);
|
||||
#else
|
||||
e = new_event(type, length, buf, database);
|
||||
#endif
|
||||
|
||||
frame = e.e[frame_arg].i;
|
||||
subframe = e.e[subframe_arg].i;
|
||||
tag = e.e[tag_arg].i;
|
||||
|
||||
if (tag < 0 || tag >= number_of_tags) {
|
||||
struct tm *tt;
|
||||
tt = localtime(&t.tv_sec);
|
||||
printf("ERROR: invalid tag (%d), skipping event for frame %d subframe %d (time %2.2d:%2.2d:%2.2d.%9.9ld)\n",
|
||||
tag, frame, subframe,
|
||||
tt->tm_hour, tt->tm_min, tt->tm_sec, t.tv_nsec);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cur_frame != frame || cur_subframe != subframe)
|
||||
if (cur_frame != -1)
|
||||
process_cache(out, cache, number_of_tags, cur_frame, cur_subframe);
|
||||
|
||||
cur_frame = frame;
|
||||
cur_subframe = subframe;
|
||||
|
||||
if (cache[tag].filled) {
|
||||
struct tm *tt;
|
||||
tt = localtime(&t.tv_sec);
|
||||
printf("ERROR: tag %d present twice at frame %d subframe %d (time %2.2d:%2.2d:%2.2d.%9.9ld)\n",
|
||||
tag, frame, subframe,
|
||||
tt->tm_hour, tt->tm_min, tt->tm_sec, t.tv_nsec);
|
||||
cache[tag].error = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
store_in_cache(cache, tag, &ebuf);
|
||||
cache[tag].filled = 1;
|
||||
cache[tag].t = t;
|
||||
}
|
||||
|
||||
if (fclose(in)) perror(input_filename);
|
||||
if (fclose(out)) perror(output_filename);
|
||||
free(cache);
|
||||
|
||||
return 0;
|
||||
}
|
||||
+366
-555
File diff suppressed because it is too large
Load Diff
@@ -606,7 +606,7 @@ void vnf_deallocate(void *ptr) {
|
||||
void vnf_trace(nfapi_trace_level_t nfapi_level, const char *message, ...) {
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
nfapi_log("FILE>", "FUNC", 999, PHY, nfapitooai_level(nfapi_level), message, args);
|
||||
VLOG( NFAPI_VNF, nfapitooai_level(nfapi_level), message, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,13 +39,14 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include "platform_constants.h"
|
||||
#ifdef UE_NAS_USE_TUN
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#include "openairinterface5g_limits.h"
|
||||
#endif
|
||||
|
||||
#include "pdcp.h"
|
||||
|
||||
char nl_rx_buf[NL_MAX_PAYLOAD];
|
||||
|
||||
@@ -54,20 +55,16 @@ struct nlmsghdr *nas_nlh_tx = NULL;
|
||||
struct nlmsghdr *nas_nlh_rx = NULL;
|
||||
struct iovec nas_iov_tx;
|
||||
struct iovec nas_iov_rx = {nl_rx_buf, sizeof(nl_rx_buf)};
|
||||
#ifdef UE_NAS_USE_TUN
|
||||
int nas_sock_fd[NUMBER_OF_UE_MAX];
|
||||
#else
|
||||
int nas_sock_fd;
|
||||
#endif
|
||||
|
||||
int nas_sock_fd[MAX_MOBILES_PER_ENB];
|
||||
|
||||
struct msghdr nas_msg_tx;
|
||||
struct msghdr nas_msg_rx;
|
||||
|
||||
#define GRAAL_NETLINK_ID 31
|
||||
|
||||
#ifdef UE_NAS_USE_TUN
|
||||
|
||||
static int tun_alloc(char *dev)
|
||||
{
|
||||
static int tun_alloc(char *dev) {
|
||||
struct ifreq ifr;
|
||||
int fd, err;
|
||||
|
||||
@@ -77,66 +74,58 @@ static int tun_alloc(char *dev)
|
||||
}
|
||||
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
|
||||
/* Flags: IFF_TUN - TUN device (no Ethernet headers)
|
||||
* IFF_TAP - TAP device
|
||||
*
|
||||
* IFF_NO_PI - Do not provide packet information
|
||||
*/
|
||||
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
|
||||
if( *dev )
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
|
||||
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){
|
||||
close(fd);
|
||||
return err;
|
||||
if( *dev )
|
||||
strncpy(ifr.ifr_name, dev, IFNAMSIZ);
|
||||
|
||||
if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ) {
|
||||
close(fd);
|
||||
return err;
|
||||
}
|
||||
|
||||
strcpy(dev, ifr.ifr_name);
|
||||
return fd;
|
||||
}
|
||||
|
||||
int netlink_init(void)
|
||||
{
|
||||
int i;
|
||||
int netlink_init_tun(void) {
|
||||
int ret;
|
||||
|
||||
char ifname[64];
|
||||
for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
sprintf(ifname, "oip%d", i+1);
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
sprintf(ifname, "oaitun_ue%d",i+1);
|
||||
nas_sock_fd[i] = tun_alloc(ifname);
|
||||
|
||||
if (nas_sock_fd[i] == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[i],errno, strerror(errno));
|
||||
printf("[NETLINK] Error opening socket %s (%d:%s)\n",ifname,errno, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[i]);
|
||||
|
||||
#if !defined(PDCP_USE_NETLINK_QUEUES)
|
||||
printf("[NETLINK]Opened socket %s with fd %d\n",ifname,nas_sock_fd[i]);
|
||||
ret = fcntl(nas_sock_fd[i],F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_fd[i], (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
|
||||
|
||||
|
||||
|
||||
ret = bind(nas_sock_fd[i], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
@@ -144,7 +133,6 @@ int netlink_init(void)
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
@@ -152,61 +140,50 @@ int netlink_init(void)
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
|
||||
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
}
|
||||
} /* for */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else /* UE_NAS_USE_TUN */
|
||||
|
||||
int netlink_init(void)
|
||||
{
|
||||
int netlink_init(void) {
|
||||
int ret;
|
||||
nas_sock_fd[0] = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
|
||||
nas_sock_fd = socket(PF_NETLINK, SOCK_RAW,GRAAL_NETLINK_ID);
|
||||
if (nas_sock_fd[0] == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd[0],errno, strerror(errno));
|
||||
|
||||
if (nas_sock_fd == -1) {
|
||||
printf("[NETLINK] Error opening socket %d (%d:%s)\n",nas_sock_fd,errno, strerror(errno));
|
||||
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
|
||||
exit(1);
|
||||
#endif
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd);
|
||||
|
||||
#if !defined(PDCP_USE_NETLINK_QUEUES)
|
||||
ret = fcntl(nas_sock_fd,F_SETFL,O_NONBLOCK);
|
||||
printf("[NETLINK]Opened socket with fd %d\n",nas_sock_fd[0]);
|
||||
ret = fcntl(nas_sock_fd[0],F_SETFL,O_NONBLOCK);
|
||||
|
||||
if (ret == -1) {
|
||||
printf("[NETLINK] Error fcntl (%d:%s)\n",errno, strerror(errno));
|
||||
#if defined(LINK_ENB_PDCP_TO_IP_DRIVER)
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
if (LINK_ENB_PDCP_TO_IP_DRIVER) {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&nas_src_addr, 0, sizeof(nas_src_addr));
|
||||
nas_src_addr.nl_family = AF_NETLINK;
|
||||
nas_src_addr.nl_pid = 1;//getpid(); /* self pid */
|
||||
nas_src_addr.nl_groups = 0; /* not in mcast groups */
|
||||
ret = bind(nas_sock_fd, (struct sockaddr*)&nas_src_addr, sizeof(nas_src_addr));
|
||||
|
||||
|
||||
|
||||
ret = bind(nas_sock_fd[0], (struct sockaddr *)&nas_src_addr, sizeof(nas_src_addr));
|
||||
memset(&nas_dest_addr, 0, sizeof(nas_dest_addr));
|
||||
nas_dest_addr.nl_family = AF_NETLINK;
|
||||
nas_dest_addr.nl_pid = 0; /* For Linux Kernel */
|
||||
nas_dest_addr.nl_groups = 0; /* unicast */
|
||||
|
||||
// TX PART
|
||||
nas_nlh_tx=(struct nlmsghdr *)malloc(NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
memset(nas_nlh_tx, 0, NLMSG_SPACE(NL_MAX_PAYLOAD));
|
||||
@@ -214,7 +191,6 @@ int netlink_init(void)
|
||||
nas_nlh_tx->nlmsg_len = NLMSG_SPACE(NL_MAX_PAYLOAD);
|
||||
nas_nlh_tx->nlmsg_pid = 1;//getpid(); /* self pid */
|
||||
nas_nlh_tx->nlmsg_flags = 0;
|
||||
|
||||
nas_iov_tx.iov_base = (void *)nas_nlh_tx;
|
||||
nas_iov_tx.iov_len = nas_nlh_tx->nlmsg_len;
|
||||
memset(&nas_msg_tx,0,sizeof(nas_msg_tx));
|
||||
@@ -222,16 +198,12 @@ int netlink_init(void)
|
||||
nas_msg_tx.msg_namelen = sizeof(nas_dest_addr);
|
||||
nas_msg_tx.msg_iov = &nas_iov_tx;
|
||||
nas_msg_tx.msg_iovlen = 1;
|
||||
|
||||
|
||||
// RX PART
|
||||
memset(&nas_msg_rx,0,sizeof(nas_msg_rx));
|
||||
nas_msg_rx.msg_name = (void *)&nas_src_addr;
|
||||
nas_msg_rx.msg_namelen = sizeof(nas_src_addr);
|
||||
nas_msg_rx.msg_iov = &nas_iov_rx;
|
||||
nas_msg_rx.msg_iovlen = 1;
|
||||
|
||||
return(nas_sock_fd);
|
||||
return(nas_sock_fd[0]);
|
||||
}
|
||||
|
||||
#endif /* UE_NAS_USE_TUN */
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#define EMU_PROTO_H_
|
||||
|
||||
void init_bypass (void);
|
||||
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char*, unsigned int*, unsigned int*),unsigned int (*rx_handlerP) (unsigned char,char*,unsigned int));
|
||||
void bypass_init ( unsigned int (*tx_handlerP) (unsigned char,char *, unsigned int *, unsigned int *),unsigned int (*rx_handlerP) (unsigned char,char *,unsigned int));
|
||||
int bypass_rx_data(unsigned int frame, unsigned int last_slot,
|
||||
unsigned int next_slot, uint8_t is_master);
|
||||
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
|
||||
@@ -43,7 +43,7 @@ void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int
|
||||
|
||||
void emulation_tx_rx(void);
|
||||
|
||||
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int* Nbytes,unsigned int *Nb_flows);
|
||||
unsigned int emul_tx_handler(unsigned char Mode,char *Tx_buffer,unsigned int *Nbytes,unsigned int *Nb_flows);
|
||||
unsigned int emul_rx_handler(unsigned char Mode,char *rx_buffer, unsigned int Nbytes);
|
||||
|
||||
unsigned int emul_rx_data(void);
|
||||
@@ -62,5 +62,6 @@ int multicast_link_read_data_from_sock(uint8_t eNB_flag);
|
||||
void clear_eNB_transport_info(uint8_t);
|
||||
void clear_UE_transport_info(uint8_t);
|
||||
int netlink_init(void);
|
||||
int netlink_init_tun(void);
|
||||
|
||||
#endif /* EMU_PROTO_H_ */
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
* Author: winckel
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Messages for NAS logging
|
||||
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg)
|
||||
@@ -46,4 +45,4 @@ MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_
|
||||
MESSAGE_DEF(NAS_UL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_ul_esm_protected_msg)
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
#endif /* ENABLE_USE_MME */
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#ifndef NAS_MESSAGES_TYPES_H_
|
||||
#define NAS_MESSAGES_TYPES_H_
|
||||
|
||||
# if defined(ENABLE_USE_MME) && defined(ENABLE_NAS_UE_LOGGING)
|
||||
|
||||
|
||||
#include "nas_message.h"
|
||||
|
||||
@@ -142,5 +142,4 @@ typedef struct nas_esm_protected_msg_s {
|
||||
ESM_msg choice;
|
||||
} nas_esm_protected_msg_t;
|
||||
|
||||
# endif /* ENABLE_USE_MME */
|
||||
#endif /* NAS_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -33,13 +33,9 @@
|
||||
#include "log.h"
|
||||
#include "log_extern.h"
|
||||
#include "assertions.h"
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#endif
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "SystemInformationBlockType2.h"
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
-------------------
|
||||
AUTHOR : Francois TABURET
|
||||
COMPANY : NOKIA BellLabs France
|
||||
EMAIL : francois.taburet@nokia-bell-labs.com
|
||||
EMAIL : francois.taburet@nokia-bell-labs.com
|
||||
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,9 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# if defined(ENABLE_USE_MME)
|
||||
# include "s1ap_eNB.h"
|
||||
# include "sctp_eNB_task.h"
|
||||
# endif
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "LTE_SystemInformationBlockType2.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "RRC_config_tools.h"
|
||||
@@ -84,8 +80,7 @@ int config_check_band_frequencies( int ind,
|
||||
int16_t band,
|
||||
uint32_t downlink_frequency,
|
||||
int32_t uplink_frequency_offset,
|
||||
uint32_t frame_type)
|
||||
{
|
||||
uint32_t frame_type) {
|
||||
int errors = 0;
|
||||
|
||||
if (band > 0) {
|
||||
@@ -94,21 +89,18 @@ int config_check_band_frequencies( int ind,
|
||||
for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) {
|
||||
if (band == eutra_bands[band_index].band) {
|
||||
uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset;
|
||||
|
||||
AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++,
|
||||
"enb %d downlink frequency %u too low (%u) for band %d!",
|
||||
ind, downlink_frequency, eutra_bands[band_index].dl_min, band);
|
||||
AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++,
|
||||
"enb %d downlink frequency %u too high (%u) for band %d!",
|
||||
ind, downlink_frequency, eutra_bands[band_index].dl_max, band);
|
||||
|
||||
AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++,
|
||||
"enb %d uplink frequency %u too low (%u) for band %d!",
|
||||
ind, uplink_frequency, eutra_bands[band_index].ul_min, band);
|
||||
AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++,
|
||||
"enb %d uplink frequency %u too high (%u) for band %d!",
|
||||
ind, uplink_frequency, eutra_bands[band_index].ul_max, band);
|
||||
|
||||
AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++,
|
||||
"enb %d invalid frame type (%d/%d) for band %d!",
|
||||
ind, eutra_bands[band_index].frame_type, frame_type, band);
|
||||
@@ -116,7 +108,6 @@ int config_check_band_frequencies( int ind,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
|
||||
+59
-94
@@ -38,39 +38,31 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# if defined(ENABLE_USE_MME)
|
||||
# define ENB_REGISTER_RETRY_DELAY 10
|
||||
# include "s1ap_eNB.h"
|
||||
# include "sctp_eNB_task.h"
|
||||
# include "gtpv1u_eNB_task.h"
|
||||
# include "flexran_agent.h"
|
||||
/* temporary warning removale while implementing noS1 */
|
||||
/* as config option */
|
||||
# else
|
||||
# ifdef EPC_MODE_ENABLED
|
||||
# undef EPC_MODE_ENABLED
|
||||
# endif
|
||||
# define EPC_MODE_ENABLED 0
|
||||
# endif
|
||||
|
||||
# include "x2ap_eNB.h"
|
||||
# include "x2ap_messages_types.h"
|
||||
# define X2AP_ENB_REGISTER_RETRY_DELAY 10
|
||||
|
||||
#include "openair1/PHY/INIT/phy_init.h"
|
||||
extern unsigned char NB_eNB_INST;
|
||||
#endif
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern int emulate_rf;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# define ENB_REGISTER_RETRY_DELAY 10
|
||||
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
# if defined(ENABLE_USE_MME)
|
||||
static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, uint32_t enb_id_end)
|
||||
{
|
||||
|
||||
static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, uint32_t enb_id_end) {
|
||||
uint32_t enb_id;
|
||||
MessageDef *msg_p;
|
||||
uint32_t register_enb_pending = 0;
|
||||
@@ -90,7 +82,6 @@ static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, u
|
||||
else { // S1AP registration
|
||||
/* note: there is an implicit relationship between the data structure and the message name */
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
|
||||
|
||||
RCconfig_S1(msg_p, enb_id);
|
||||
|
||||
if (enb_id == 0) RCconfig_gtpu();
|
||||
@@ -107,26 +98,19 @@ static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, u
|
||||
|
||||
return register_enb_pending;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
|
||||
{
|
||||
static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end) {
|
||||
uint32_t enb_id;
|
||||
MessageDef *msg_p;
|
||||
uint32_t register_enb_x2_pending = 0;
|
||||
|
||||
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
|
||||
|
||||
{
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_ENB_APP, X2AP_REGISTER_ENB_REQ);
|
||||
|
||||
RCconfig_X2(msg_p, enb_id);
|
||||
|
||||
itti_send_msg_to_task (TASK_X2AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
|
||||
register_enb_x2_pending++;
|
||||
}
|
||||
}
|
||||
@@ -135,17 +119,13 @@ static uint32_t eNB_app_register_x2(uint32_t enb_id_start, uint32_t enb_id_end)
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *eNB_app_task(void *args_p)
|
||||
{
|
||||
#if defined(ENABLE_ITTI)
|
||||
void *eNB_app_task(void *args_p) {
|
||||
uint32_t enb_nb = RC.nb_inst;
|
||||
uint32_t enb_id_start = 0;
|
||||
uint32_t enb_id_end = enb_id_start + enb_nb;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
uint32_t register_enb_pending=0;
|
||||
uint32_t registered_enb;
|
||||
uint32_t registered_enb=0;
|
||||
long enb_register_retry_timer_id;
|
||||
# endif
|
||||
uint32_t x2_register_enb_pending = 0;
|
||||
uint32_t x2_registered_enb = 0;
|
||||
long x2_enb_register_retry_timer_id;
|
||||
@@ -154,19 +134,13 @@ void *eNB_app_task(void *args_p)
|
||||
int result;
|
||||
/* for no gcc warnings */
|
||||
(void)instance;
|
||||
|
||||
itti_mark_task_ready (TASK_ENB_APP);
|
||||
|
||||
# if defined(ENABLE_USE_MME)
|
||||
/* Try to register each eNB */
|
||||
registered_enb = 0;
|
||||
// This assumes that node_type of all RRC instances is the same
|
||||
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
# else
|
||||
/* Start L2L1 task */
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, msg_p);
|
||||
#endif
|
||||
if (EPC_MODE_ENABLED) {
|
||||
register_enb_pending = eNB_app_register(RC.rrc[0]->node_type, enb_id_start, enb_id_end);
|
||||
}
|
||||
|
||||
/* Try to register each eNB with each other */
|
||||
if (RC.rrc[0]->node_type == ngran_eNB) { // CU or DU do not need
|
||||
@@ -175,7 +149,6 @@ void *eNB_app_task(void *args_p)
|
||||
do {
|
||||
// Wait for a message
|
||||
itti_receive_msg (TASK_ENB_APP, &msg_p);
|
||||
|
||||
instance = ITTI_MSG_INSTANCE (msg_p);
|
||||
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
@@ -194,44 +167,40 @@ void *eNB_app_task(void *args_p)
|
||||
|
||||
case S1AP_REGISTER_ENB_CNF:
|
||||
AssertFatal(RC.rrc[0]->node_type != ngran_eNB_DU, "Should not have received S1AP_REGISTER_ENB_CNF\n");
|
||||
if (EPC_MODE_ENABLED) {
|
||||
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
|
||||
LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
|
||||
|
||||
|
||||
DevAssert(register_enb_pending > 0);
|
||||
register_enb_pending--;
|
||||
|
||||
/* Check if at least eNB is registered with one MME */
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start L2L1 task */
|
||||
MessageDef *msg_init_p;
|
||||
|
||||
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
|
||||
} else {
|
||||
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
|
||||
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
|
||||
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
|
||||
|
||||
sleep(ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);//, enb_properties_p);
|
||||
/* Check if at least eNB is registered with one MME */
|
||||
if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
|
||||
registered_enb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if all register eNB requests have been processed */
|
||||
if (register_enb_pending == 0) {
|
||||
if (registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start L2L1 task */
|
||||
MessageDef *msg_init_p;
|
||||
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
|
||||
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
|
||||
} else {
|
||||
LOG_W(ENB_APP, " %d eNB not associated with a MME, retrying registration in %d seconds ...\n",
|
||||
enb_nb - registered_enb, ENB_REGISTER_RETRY_DELAY);
|
||||
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
|
||||
NULL, &enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
|
||||
sleep(ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
registered_enb = 0;
|
||||
register_enb_pending = eNB_app_register (RC.rrc[0]->node_type,enb_id_start, enb_id_end);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
break;
|
||||
|
||||
@@ -283,13 +252,13 @@ void *eNB_app_task(void *args_p)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
|
||||
|
||||
/* TODO handle recovering of registration */
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TIMER_HAS_EXPIRED:
|
||||
# if defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
LOG_I(ENB_APP, " Received %s: timer_id %ld\n", ITTI_MSG_NAME (msg_p), TIMER_HAS_EXPIRED(msg_p).timer_id);
|
||||
|
||||
if (TIMER_HAS_EXPIRED (msg_p).timer_id == enb_register_retry_timer_id) {
|
||||
@@ -303,20 +272,19 @@ void *eNB_app_task(void *args_p)
|
||||
x2_registered_enb = 0;
|
||||
x2_register_enb_pending = eNB_app_register_x2 (enb_id_start, enb_id_end);
|
||||
}
|
||||
# endif
|
||||
} /* if (EPC_MODE_ENABLED) */
|
||||
|
||||
break;
|
||||
|
||||
case X2AP_DEREGISTERED_ENB_IND:
|
||||
LOG_W(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
X2AP_DEREGISTERED_ENB_IND(msg_p).nb_x2);
|
||||
|
||||
/* TODO handle recovering of registration */
|
||||
break;
|
||||
|
||||
case X2AP_REGISTER_ENB_CNF:
|
||||
LOG_I(ENB_APP, "[eNB %d] Received %s: associated eNB %d\n", instance, ITTI_MSG_NAME (msg_p),
|
||||
X2AP_REGISTER_ENB_CNF(msg_p).nb_x2);
|
||||
|
||||
DevAssert(x2_register_enb_pending > 0);
|
||||
x2_register_enb_pending--;
|
||||
|
||||
@@ -329,19 +297,17 @@ void *eNB_app_task(void *args_p)
|
||||
if (x2_register_enb_pending == 0) {
|
||||
if (x2_registered_enb == enb_nb) {
|
||||
/* If all eNB are registered, start RRC HO task */
|
||||
|
||||
}else {
|
||||
} else {
|
||||
uint32_t x2_not_associated = enb_nb - x2_registered_enb;
|
||||
|
||||
LOG_W(ENB_APP, " %d eNB %s not associated with the target\n",
|
||||
x2_not_associated, x2_not_associated > 1 ? "are" : "is");
|
||||
|
||||
// timer to retry
|
||||
/* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
|
||||
if (timer_setup (X2AP_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP,
|
||||
INSTANCE_DEFAULT, TIMER_ONE_SHOT, NULL,
|
||||
&x2_enb_register_retry_timer_id) < 0) {
|
||||
LOG_E(ENB_APP, " Can not start eNB X2AP register: retry timer, use \"sleep\" instead!\n");
|
||||
|
||||
sleep(X2AP_ENB_REGISTER_RETRY_DELAY);
|
||||
/* Restart the registration process */
|
||||
x2_registered_enb = 0;
|
||||
@@ -361,18 +327,13 @@ void *eNB_app_task(void *args_p)
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
} while (1);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void handle_reconfiguration(module_id_t mod_id)
|
||||
{
|
||||
void handle_reconfiguration(module_id_t mod_id) {
|
||||
struct timespec start, end;
|
||||
clock_gettime(CLOCK_MONOTONIC, &start);
|
||||
flexran_agent_info_t *flexran = RC.flexran[mod_id];
|
||||
|
||||
LOG_I(ENB_APP, "lte-softmodem soft-restart requested\n");
|
||||
|
||||
if (ENB_WAIT == flexran->node_ctrl_state) {
|
||||
@@ -395,8 +356,10 @@ void handle_reconfiguration(module_id_t mod_id)
|
||||
LOG_I(ENB_APP, " * eNB %d: Waiting for FlexRAN RTController command *\n", mod_id);
|
||||
pthread_mutex_lock(&flexran->mutex_node_ctrl);
|
||||
flexran->node_ctrl_state = ENB_WAIT;
|
||||
|
||||
while (ENB_NORMAL_OPERATION != flexran->node_ctrl_state)
|
||||
pthread_cond_wait(&flexran->cond_node_ctrl, &flexran->mutex_node_ctrl);
|
||||
|
||||
pthread_mutex_unlock(&flexran->mutex_node_ctrl);
|
||||
}
|
||||
|
||||
@@ -408,11 +371,13 @@ void handle_reconfiguration(module_id_t mod_id)
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &end);
|
||||
end.tv_sec -= start.tv_sec;
|
||||
|
||||
if (end.tv_nsec >= start.tv_nsec) {
|
||||
end.tv_nsec -= start.tv_nsec;
|
||||
} else {
|
||||
end.tv_sec -= 1;
|
||||
end.tv_nsec = end.tv_nsec - start.tv_nsec + 1000000000;
|
||||
}
|
||||
|
||||
LOG_I(ENB_APP, "lte-softmodem restart succeeded in %ld.%ld s\n", end.tv_sec, end.tv_nsec / 1000000);
|
||||
}
|
||||
|
||||
+86
-201
@@ -35,15 +35,9 @@
|
||||
#include "enb_config.h"
|
||||
#include "UTIL/OTG/otg.h"
|
||||
#include "UTIL/OTG/otg_externs.h"
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#else
|
||||
#define EPC_MODE_ENABLED 0
|
||||
#endif
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "sctp_default_values.h"
|
||||
#include "LTE_SystemInformationBlockType2.h"
|
||||
@@ -214,7 +208,7 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
|
||||
|
||||
RC.nb_macrlc_inst=MacRLC_ParamList.numelt;
|
||||
mac_top_init_eNB();
|
||||
RC.nb_mac_CC = (int*)malloc(RC.nb_macrlc_inst*sizeof(int));
|
||||
RC.nb_mac_CC = (int *)malloc(RC.nb_macrlc_inst*sizeof(int));
|
||||
|
||||
for (j = 0; j < RC.nb_macrlc_inst; j++) {
|
||||
RC.mac[j]->puSch10xSnr = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCH10xSNR_IDX ].iptr);
|
||||
@@ -286,36 +280,27 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
ccparams_lte_t ccparams_lte;
|
||||
ccparams_sidelink_t SLconfig;
|
||||
ccparams_eMTC_t eMTCconfig;
|
||||
|
||||
memset((void*)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
memset((void*)&SLconfig,0,sizeof(ccparams_sidelink_t));
|
||||
memset((void*)&eMTCconfig,0,sizeof(ccparams_eMTC_t));
|
||||
|
||||
|
||||
memset((void *)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
memset((void *)&SLconfig,0,sizeof(ccparams_sidelink_t));
|
||||
memset((void *)&eMTCconfig,0,sizeof(ccparams_eMTC_t));
|
||||
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
||||
paramdef_t ENBParams[] = ENBPARAMS_DESC;
|
||||
paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0};
|
||||
checkedparam_t config_check_CCparams[] = CCPARAMS_CHECK;
|
||||
paramdef_t CCsParams[] = CCPARAMS_DESC(ccparams_lte);
|
||||
paramlist_def_t CCsParamList = {ENB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0};
|
||||
|
||||
paramdef_t eMTCParams[] = EMTCPARAMS_DESC((&eMTCconfig));
|
||||
checkedparam_t config_check_eMTCparams[] = EMTCPARAMS_CHECK;
|
||||
|
||||
srb1_params_t srb1_params;
|
||||
memset((void*)&srb1_params,0,sizeof(srb1_params_t));
|
||||
memset((void *)&srb1_params,0,sizeof(srb1_params_t));
|
||||
paramdef_t SRB1Params[] = SRB1PARAMS_DESC(srb1_params);
|
||||
|
||||
|
||||
paramdef_t SLParams[] = CCPARAMS_SIDELINK_DESC(SLconfig);
|
||||
|
||||
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
for (int I=0; I< ( sizeof(CCsParams)/ sizeof(paramdef_t) ) ; I++) {
|
||||
CCsParams[I].chkPptr = &(config_check_CCparams[I]);
|
||||
}
|
||||
|
||||
|
||||
for (int I = 0; I < (sizeof(CCsParams) / sizeof(paramdef_t)); I++) {
|
||||
eMTCParams[I].chkPptr = &(config_check_eMTCparams[I]);
|
||||
}
|
||||
@@ -455,6 +440,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
AssertFatal (ccparams_lte.tdd_config_s <= LTE_TDD_Config__specialSubframePatterns_ssp8,
|
||||
"Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!",
|
||||
RC.config_file_name, i, ccparams_lte.tdd_config_s, LTE_TDD_Config__specialSubframePatterns_ssp8);
|
||||
|
||||
if (!ccparams_lte.prefix_type)
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n",
|
||||
@@ -489,8 +475,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = ccparams_lte.eutra_band;
|
||||
RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) ccparams_lte.downlink_frequency;
|
||||
RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) ccparams_lte.uplink_frequency_offset;
|
||||
|
||||
|
||||
RRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= ccparams_lte.Nid_cell;
|
||||
|
||||
if (ccparams_lte.Nid_cell>503) {
|
||||
@@ -530,7 +514,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
AssertFatal(0, "error calling enb_check_band_frequencies\n");
|
||||
}
|
||||
|
||||
|
||||
if ((ccparams_lte.nb_antenna_ports <1) || (ccparams_lte.nb_antenna_ports > 2))
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n",
|
||||
@@ -541,7 +524,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (rrc->node_type != ngran_eNB_DU) {//this is CU or eNB, SIB2-20 in CU
|
||||
// Radio Resource Configuration (SIB2)
|
||||
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].prach_root = ccparams_lte.prach_root;
|
||||
|
||||
if ((ccparams_lte.prach_root <0) || (ccparams_lte.prach_root > 1023))
|
||||
@@ -609,7 +591,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pucch_nCS_AN);
|
||||
|
||||
|
||||
//#if (LTE_RRC_VERSION < MAKE_VERSION(10, 0, 0))
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_n1_AN = ccparams_lte.pucch_n1_AN;
|
||||
|
||||
@@ -648,11 +629,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n",
|
||||
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE);
|
||||
|
||||
else if (strcmp(ccparams_lte.pusch_hoppingMode,"interSubFrame")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_hoppingMode,"intraAndInterSubFrame")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_hoppingMode,"intraAndInterSubFrame")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_hoppingMode = LTE_PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame;
|
||||
} else
|
||||
AssertFatal (0,
|
||||
@@ -673,11 +652,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM);
|
||||
else if (strcmp(ccparams_lte.pusch_enable64QAM, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_enable64QAM, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_enable64QAM, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_enable64QAM = FALSE;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pusch_enable64QAM);
|
||||
@@ -688,11 +665,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN);
|
||||
else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled = TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_groupHoppingEnabled, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_groupHoppingEnabled= FALSE;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pusch_groupHoppingEnabled);
|
||||
@@ -711,8 +686,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN);
|
||||
else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_sequenceHoppingEnabled, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_sequenceHoppingEnabled = FALSE;
|
||||
} else
|
||||
AssertFatal (0,
|
||||
@@ -727,7 +701,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_nDMRS1 choice: 0..7!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pusch_nDMRS1);
|
||||
|
||||
|
||||
if (strcmp(ccparams_lte.phich_duration,"NORMAL")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_duration= LTE_PHICH_Config__phich_Duration_normal;
|
||||
} else if (strcmp(ccparams_lte.phich_duration,"EXTENDED")==0) {
|
||||
@@ -739,17 +712,13 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.phich_resource,"ONESIXTH")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_oneSixth ;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.phich_resource,"HALF")==0) {
|
||||
} else if (strcmp(ccparams_lte.phich_resource,"HALF")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_half;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.phich_resource,"ONE")==0) {
|
||||
} else if (strcmp(ccparams_lte.phich_resource,"ONE")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_one;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.phich_resource,"TWO")==0) {
|
||||
} else if (strcmp(ccparams_lte.phich_resource,"TWO")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].phich_resource= LTE_PHICH_Config__phich_Resource_two;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n",
|
||||
RC.config_file_name, i, ccparams_lte.phich_resource);
|
||||
@@ -760,11 +729,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.srs_enable, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.srs_enable, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.srs_enable, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_enable= FALSE;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n",
|
||||
RC.config_file_name, i, ccparams_lte.srs_enable);
|
||||
@@ -787,8 +754,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.srs_ackNackST, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.srs_ackNackST, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.srs_ackNackST, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_ackNackST= FALSE;
|
||||
} else
|
||||
AssertFatal (0,
|
||||
@@ -797,11 +763,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.srs_MaxUpPts, "ENABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= TRUE;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.srs_MaxUpPts, "DISABLE") == 0) {
|
||||
} else if (strcmp(ccparams_lte.srs_MaxUpPts, "DISABLE") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].srs_MaxUpPts= FALSE;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n",
|
||||
RC.config_file_name, i, ccparams_lte.srs_MaxUpPts);
|
||||
@@ -819,26 +783,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.pusch_alpha,"AL0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL04")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL04")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al04;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL05")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL05")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al05;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL06")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL06")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al06;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL07")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL07")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al07;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL08")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL08")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al08;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL09")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL09")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al09;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL1")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL1")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_UplinkPowerControlCommon__alpha_al1;
|
||||
}
|
||||
|
||||
@@ -847,26 +804,19 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.pusch_alpha,"AL0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL04")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL04")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al04;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL05")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL05")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al05;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL06")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL06")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al06;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL07")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL07")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al07;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL08")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL08")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al08;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL09")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL09")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al09;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pusch_alpha,"AL1")==0) {
|
||||
} else if (strcmp(ccparams_lte.pusch_alpha,"AL1")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pusch_alpha= LTE_Alpha_r12_al1;
|
||||
}
|
||||
|
||||
@@ -894,42 +844,33 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF_2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF0")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF2")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format1,"deltaF2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format1);
|
||||
|
||||
if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF1")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF3")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF3")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF5")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format1b,"deltaF5")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format1b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format1b);
|
||||
|
||||
if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF_2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF0")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF1")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF1")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF2")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2,"deltaF2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2;
|
||||
} else
|
||||
AssertFatal (0,
|
||||
@@ -938,28 +879,22 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF_2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF0")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF2")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2a,"deltaF2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2a= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format2a);
|
||||
|
||||
if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF_2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF0")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF2")==0) {
|
||||
} else if (strcmp(ccparams_lte.pucch_deltaF_Format2b,"deltaF2")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pucch_deltaF_Format2b= LTE_DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n",
|
||||
RC.config_file_name, i, ccparams_lte.pucch_deltaF_Format2b);
|
||||
@@ -1010,29 +945,21 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"minusinfinity")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB0")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB0")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB5")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB5")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB8")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB8")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB10")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB10")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB12")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB12")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB15")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB15")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB18")==0) {
|
||||
} else if (strcmp(ccparams_lte.rach_messagePowerOffsetGroupB,"dB18")==0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_messagePowerOffsetGroupB= LTE_RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n",
|
||||
RC.config_file_name, i, ccparams_lte.rach_messagePowerOffsetGroupB);
|
||||
@@ -1152,7 +1079,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
case 200:
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].rach_preambleTransMax= LTE_PreambleTransMax_n200;
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
default:
|
||||
@@ -1214,29 +1140,21 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
|
||||
if (strcmp(ccparams_lte.pcch_nB, "fourT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_fourT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "twoT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_twoT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "oneT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "halfT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_halfT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "quarterT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_quarterT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "oneEighthT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneEighthT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "oneSixteenthT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneSixteenthT;
|
||||
}
|
||||
else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) {
|
||||
} else if (strcmp(ccparams_lte.pcch_nB, "oneThirtySecondT") == 0) {
|
||||
RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].pcch_nB= LTE_PCCH_Config__nB_oneThirtySecondT;
|
||||
}
|
||||
else
|
||||
} else
|
||||
AssertFatal (0,
|
||||
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n",
|
||||
RC.config_file_name, i, ccparams_lte.pcch_nB);
|
||||
@@ -1348,7 +1266,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
// eMBMS configuration
|
||||
RRC_CONFIGURATION_REQ(msg_p).eMBMS_configured = 0;
|
||||
printf("No eMBMS configuration, skipping it\n");
|
||||
|
||||
// eMTC configuration
|
||||
char brparamspath[MAX_OPTNAME_SIZE*2 + 16];
|
||||
sprintf(brparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_EMTC_PARAMETERS);
|
||||
@@ -1358,14 +1275,13 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
if (eMTCconfig.eMTC_configured > 0) fill_eMTC_configuration(msg_p,&eMTCconfig, i,j,RC.config_file_name,brparamspath);
|
||||
else printf("No eMTC configuration, skipping it\n");
|
||||
|
||||
|
||||
// Sidelink configuration
|
||||
char SLparamspath[MAX_OPTNAME_SIZE*2 + 16];
|
||||
sprintf(SLparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_SL_PARAMETERS);
|
||||
config_get( SLParams, sizeof(SLParams)/sizeof(paramdef_t), SLparamspath);
|
||||
|
||||
// Sidelink Resource pool information
|
||||
RRC_CONFIGURATION_REQ (msg_p).SL_configured=SLconfig.sidelink_configured&1;
|
||||
|
||||
if (SLconfig.sidelink_configured==1) fill_SL_configuration(msg_p,&SLconfig,i,j,RC.config_file_name);
|
||||
else printf("No SL configuration skipping it\n");
|
||||
} // node_type!=ngran_eNB_DU
|
||||
@@ -1376,7 +1292,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
sprintf(srb1path,"%s.%s",enbpath,ENB_CONFIG_STRING_SRB1);
|
||||
config_get( SRB1Params,sizeof(SRB1Params)/sizeof(paramdef_t), srb1path);
|
||||
|
||||
|
||||
switch (srb1_params.srb1_max_retx_threshold) {
|
||||
case 1:
|
||||
rrc->srb1_max_retx_threshold = LTE_UL_AM_RLC__maxRetxThreshold_t1;
|
||||
@@ -1676,10 +1591,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined (ENABLE_ITTI)
|
||||
memcpy(&RC.rrc[i]->configuration, &RRC_CONFIGURATION_REQ(msg_p),
|
||||
sizeof(RRC_CONFIGURATION_REQ(msg_p)));
|
||||
#endif
|
||||
memcpy(&rrc->configuration, &RRC_CONFIGURATION_REQ(msg_p), sizeof(RRC_CONFIGURATION_REQ(msg_p)));
|
||||
}
|
||||
LOG_I(RRC,"Node type %d \n ", rrc->node_type);
|
||||
|
||||
@@ -1901,12 +1813,8 @@ int RCconfig_S1(
|
||||
const char *active_enb[MAX_ENB];
|
||||
char *address = NULL;
|
||||
char *cidr = NULL;
|
||||
|
||||
ccparams_lte_t ccparams_lte;
|
||||
|
||||
memset((void*)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
|
||||
|
||||
memset((void *)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
// for no gcc warnings
|
||||
(void)my_int;
|
||||
memset((char *)active_enb, 0, MAX_ENB * sizeof(char *));
|
||||
@@ -2134,18 +2042,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
int enb_id;
|
||||
char *address = NULL;
|
||||
char *cidr = NULL;
|
||||
|
||||
ccparams_lte_t ccparams_lte;
|
||||
|
||||
memset((void*)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
|
||||
|
||||
memset((void *)&ccparams_lte,0,sizeof(ccparams_lte_t));
|
||||
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
|
||||
paramdef_t ENBParams[] = ENBPARAMS_DESC;
|
||||
paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0};
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
|
||||
|
||||
checkedparam_t config_check_CCparams[] = CCPARAMS_CHECK;
|
||||
paramdef_t CCsParams[] = CCPARAMS_DESC(ccparams_lte);
|
||||
paramlist_def_t CCsParamList = {ENB_CONFIG_STRING_COMPONENT_CARRIERS, NULL, 0};
|
||||
@@ -2155,21 +2058,6 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
CCsParams[I].chkPptr = &(config_check_CCparams[I]);
|
||||
}
|
||||
|
||||
/*#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
|
||||
asn_debug = 0;
|
||||
asn1_xer_print = 0;
|
||||
} else if (strcasecmp( *(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr), ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) {
|
||||
asn_debug = 1;
|
||||
asn1_xer_print = 1;
|
||||
} else if (strcasecmp(*(ENBSParams[ENB_ASN1_VERBOSITY_IDX].strptr) , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) {
|
||||
asn_debug = 1;
|
||||
asn1_xer_print = 2;
|
||||
} else {
|
||||
asn_debug = 0;
|
||||
asn1_xer_print = 0;
|
||||
}
|
||||
#endif */
|
||||
AssertFatal(i < ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt,
|
||||
"Failed to parse config file %s, %uth attribute %s \n",
|
||||
RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
|
||||
@@ -2182,13 +2070,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
for (k = 0; k < ENBParamList.numelt; k++) {
|
||||
if (ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr == NULL) {
|
||||
// Calculate a default eNB ID
|
||||
# if defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
uint32_t hash;
|
||||
hash = s1ap_generate_eNB_id ();
|
||||
enb_id = k + (hash & 0xFFFF8);
|
||||
# else
|
||||
} else {
|
||||
enb_id = k;
|
||||
# endif
|
||||
}
|
||||
} else {
|
||||
enb_id = *(ENBParamList.paramarray[k][ENB_ENB_ID_IDX].uptr);
|
||||
}
|
||||
@@ -2233,7 +2121,6 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
AssertFatal(0, "The number of PLMN IDs must be in [1,6], but is %d\n",
|
||||
PLMNParamList.numelt);
|
||||
|
||||
|
||||
if (PLMNParamList.numelt > 1)
|
||||
LOG_W(X2AP, "X2AP currently handles only one PLMN, ignoring the others!\n");
|
||||
|
||||
@@ -2309,16 +2196,17 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_SCTP_CONFIG);
|
||||
config_get( SCTPParams,sizeof(SCTPParams)/sizeof(paramdef_t),aprefix);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)*(SCTPParams[ENB_SCTP_INSTREAMS_IDX].uptr);
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)*(SCTPParams[ENB_SCTP_OUTSTREAMS_IDX].uptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
sprintf(aprefix,"%s.[%i].%s",ENB_CONFIG_STRING_ENB_LIST,k,ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
|
||||
// NETWORK_INTERFACES
|
||||
config_get( NETParams,sizeof(NETParams)/sizeof(paramdef_t),aprefix);
|
||||
@@ -2346,34 +2234,32 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
int RCconfig_parallel(void) {
|
||||
char *parallel_conf = NULL;
|
||||
char *worker_conf = NULL;
|
||||
|
||||
|
||||
paramdef_t ThreadParams[] = THREAD_CONF_DESC;
|
||||
paramlist_def_t THREADParamList = {THREAD_CONFIG_STRING_THREAD_STRUCT,NULL,0};
|
||||
config_getlist( &THREADParamList,NULL,0,NULL);
|
||||
|
||||
if(parallel_config == NULL){
|
||||
if(parallel_config == NULL) {
|
||||
if(THREADParamList.numelt>0) {
|
||||
config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL);
|
||||
parallel_conf = strdup(*(THREADParamList.paramarray[0][THREAD_PARALLEL_IDX].strptr));
|
||||
} else {
|
||||
parallel_conf = strdup("PARALLEL_RU_L1_TRX_SPLIT");
|
||||
}
|
||||
|
||||
set_parallel_conf(parallel_conf);
|
||||
}
|
||||
|
||||
if(worker_config == NULL){
|
||||
if(worker_config == NULL) {
|
||||
if(THREADParamList.numelt>0) {
|
||||
config_getlist( &THREADParamList,ThreadParams,sizeof(ThreadParams)/sizeof(paramdef_t),NULL);
|
||||
worker_conf = strdup(*(THREADParamList.paramarray[0][THREAD_WORKER_IDX].strptr));
|
||||
} else {
|
||||
worker_conf = strdup("WORKER_ENABLE");
|
||||
}
|
||||
|
||||
set_worker_conf(worker_conf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2390,13 +2276,12 @@ void RCConfig(void) {
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
printf("Getting ENBSParams\n");
|
||||
config_get( ENBSParams,sizeof(ENBSParams)/sizeof(paramdef_t),NULL);
|
||||
# if defined(ENABLE_USE_MME)
|
||||
EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0);
|
||||
#endif
|
||||
//EPC_MODE_ENABLED = ((*ENBSParams[ENB_NOS1_IDX].uptr) == 0);
|
||||
RC.nb_inst = ENBSParams[ENB_ACTIVE_ENBS_IDX].numelt;
|
||||
|
||||
if (RC.nb_inst > 0) {
|
||||
RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int));
|
||||
|
||||
for (int i=0; i<RC.nb_inst; i++) {
|
||||
sprintf(aprefix,"%s.[%i]",ENB_CONFIG_STRING_ENB_LIST,i);
|
||||
config_getlist( &CCsParamList,NULL,0, aprefix);
|
||||
|
||||
@@ -45,114 +45,89 @@
|
||||
#include "common/ran_context.h"
|
||||
extern FILL_UL_INFO_MUTEX_t fill_ul_mutex;
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void openair_rrc_top_init_ue( int eMBMS_active, char* uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
|
||||
extern void openair_rrc_top_init_ue( int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
|
||||
|
||||
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) //init as MR
|
||||
{
|
||||
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
|
||||
module_idP, frameP, eNB_index);
|
||||
#if defined(ENABLE_USE_MME)
|
||||
int mme_enabled = 1;
|
||||
#else
|
||||
int mme_enabled = 0;
|
||||
#endif
|
||||
void dl_phy_sync_success(module_id_t module_idP, frame_t frameP, unsigned char eNB_index, uint8_t first_sync) { //init as MR
|
||||
LOG_D(MAC, "[UE %d] Frame %d: PHY Sync to eNB_index %d successful \n",
|
||||
module_idP, frameP, eNB_index);
|
||||
|
||||
if (first_sync == 1 && !(mme_enabled == 1)) {
|
||||
//layer2_init_UE(module_idP);
|
||||
openair_rrc_ue_init(module_idP, eNB_index);
|
||||
} else {
|
||||
rrc_in_sync_ind(module_idP, frameP, eNB_index);
|
||||
}
|
||||
if (first_sync == 1 && !(EPC_MODE_ENABLED)) {
|
||||
//layer2_init_UE(module_idP);
|
||||
openair_rrc_ue_init(module_idP, eNB_index);
|
||||
} else {
|
||||
rrc_in_sync_ind(module_idP, frameP, eNB_index);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mac_UE_out_of_sync_ind(module_id_t module_idP, frame_t frameP,
|
||||
uint16_t eNB_index)
|
||||
{
|
||||
|
||||
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
|
||||
uint16_t eNB_index) {
|
||||
// Mac_rlc_xface->mac_out_of_sync_ind(Mod_id, frameP, eNB_index);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mac_top_init_ue(int eMBMS_active, char *uecap_xer,
|
||||
uint8_t cba_group_active, uint8_t HO_active)
|
||||
{
|
||||
uint8_t cba_group_active, uint8_t HO_active) {
|
||||
int i;
|
||||
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
|
||||
|
||||
int i;
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_mac_inst =
|
||||
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
AssertFatal(UE_mac_inst != NULL,
|
||||
"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",
|
||||
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST,
|
||||
sizeof(UE_MAC_INST));
|
||||
LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",
|
||||
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst);
|
||||
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
LOG_I(MAC, "[MAIN] Init function start:Nb_UE_INST=%d\n", NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 0) {
|
||||
UE_mac_inst =
|
||||
(UE_MAC_INST *) malloc16(NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
AssertFatal(UE_mac_inst != NULL,
|
||||
"[MAIN] Can't ALLOCATE %zu Bytes for %d UE_MAC_INST with size %zu \n",
|
||||
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST,
|
||||
sizeof(UE_MAC_INST));
|
||||
|
||||
LOG_D(MAC, "[MAIN] ALLOCATE %zu Bytes for %d UE_MAC_INST @ %p\n",
|
||||
NB_UE_INST * sizeof(UE_MAC_INST), NB_UE_INST, UE_mac_inst);
|
||||
|
||||
bzero(UE_mac_inst, NB_UE_INST * sizeof(UE_MAC_INST));
|
||||
|
||||
for (i = 0; i < NB_UE_INST; i++) {
|
||||
ue_init_mac(i);
|
||||
}
|
||||
} else {
|
||||
UE_mac_inst = NULL;
|
||||
for (i = 0; i < NB_UE_INST; i++) {
|
||||
ue_init_mac(i);
|
||||
}
|
||||
} else {
|
||||
UE_mac_inst = NULL;
|
||||
}
|
||||
|
||||
// mutex below are used for multiple UE's L2 FAPI simulation.
|
||||
if (nfapi_mode == 3){
|
||||
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.harq_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] calling RRC\n");
|
||||
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
|
||||
HO_active);
|
||||
|
||||
|
||||
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
|
||||
|
||||
return (0);
|
||||
// mutex below are used for multiple UE's L2 FAPI simulation.
|
||||
if (nfapi_mode == 3) {
|
||||
pthread_mutex_init(&fill_ul_mutex.rx_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.crc_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.sr_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.harq_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.cqi_mutex,NULL);
|
||||
pthread_mutex_init(&fill_ul_mutex.rach_mutex,NULL);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] calling RRC\n");
|
||||
openair_rrc_top_init_ue(eMBMS_active, uecap_xer, cba_group_active,
|
||||
HO_active);
|
||||
LOG_I(MAC, "[MAIN][INIT] Init function finished\n");
|
||||
return (0);
|
||||
}
|
||||
|
||||
int rlcmac_init_global_param_ue(void)
|
||||
{
|
||||
int rlcmac_init_global_param_ue(void) {
|
||||
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
|
||||
|
||||
if (rlc_module_init() != 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
LOG_I(MAC, "[MAIN] CALLING RLC_MODULE_INIT...\n");
|
||||
|
||||
if (rlc_module_init() != 0) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
pdcp_layer_init();
|
||||
|
||||
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
|
||||
|
||||
return 0;
|
||||
pdcp_layer_init();
|
||||
LOG_I(MAC, "[MAIN] Init Global Param Done\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
l2_init_ue(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,
|
||||
uint8_t HO_active)
|
||||
{
|
||||
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
// NB_NODE=2;
|
||||
// NB_INST=2;
|
||||
|
||||
rlcmac_init_global_param_ue();
|
||||
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
|
||||
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
|
||||
return (1);
|
||||
uint8_t HO_active) {
|
||||
LOG_I(MAC, "[MAIN] MAC_INIT_GLOBAL_PARAM IN...\n");
|
||||
// NB_NODE=2;
|
||||
// NB_INST=2;
|
||||
rlcmac_init_global_param_ue();
|
||||
LOG_I(MAC, "[MAIN] init UE MAC functions \n");
|
||||
mac_top_init_ue(eMBMS_active, uecap_xer, cba_group_active, HO_active);
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
@@ -583,9 +583,9 @@ ue_send_sdu(module_id_t module_idP,
|
||||
rx_lengths[i],
|
||||
1,
|
||||
NULL);
|
||||
|
||||
|
||||
} else if ((rx_lcids[i] < NB_RB_MAX) && (rx_lcids[i] > DCCH1 )) {
|
||||
|
||||
|
||||
LOG_D(MAC,"[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n", module_idP, frameP,rx_lcids[i], eNB_index,rx_lengths[i]);
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
@@ -2573,8 +2573,12 @@ ue_scheduler(const module_id_t module_idP,
|
||||
// data to/from NETLINK is treated in pdcp_run.
|
||||
// one socket is used in multiple UE's L2 FAPI simulator and
|
||||
// only first UE need to do this.
|
||||
if(module_idP == 0){
|
||||
if (UE_NAS_USE_TUN) {
|
||||
pdcp_run(&ctxt);
|
||||
} else {
|
||||
if(module_idP == 0){
|
||||
pdcp_run(&ctxt);
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
UE_mac_inst[module_idP].txFrame = txFrameP;
|
||||
|
||||
+274
-174
@@ -28,7 +28,6 @@
|
||||
*/
|
||||
|
||||
#define PDCP_C
|
||||
//#define DEBUG_PDCP_FIFO_FLUSH_SDU
|
||||
|
||||
#define MBMS_MULTICAST_OUT
|
||||
|
||||
@@ -51,26 +50,20 @@
|
||||
#include "msc.h"
|
||||
#include "common/ngran_types.h"
|
||||
#include "targets/COMMON/openairinterface5g_limits.h"
|
||||
#if defined(ENABLE_SECURITY)
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#endif
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
# include "intertask_interface.h"
|
||||
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#include "gtpv1u.h"
|
||||
#endif
|
||||
|
||||
# include "gtpv1u_eNB_task.h"
|
||||
# include "gtpv1u.h"
|
||||
|
||||
#include "ENB_APP/enb_config.h"
|
||||
#include "LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
|
||||
extern int otg_enabled;
|
||||
#if defined(ENABLE_USE_MME)
|
||||
extern uint8_t nfapi_mode;
|
||||
#endif
|
||||
extern uint8_t nfapi_mode;
|
||||
#include "common/ran_context.h"
|
||||
extern RAN_CONTEXT_t RC;
|
||||
hash_table_t *pdcp_coll_p = NULL;
|
||||
@@ -86,6 +79,13 @@ hash_table_t *pdcp_coll_p = NULL;
|
||||
static int mbms_socket = -1;
|
||||
#endif
|
||||
|
||||
|
||||
/* pdcp module parameters and related functions*/
|
||||
static pdcp_params_t pdcp_params= {0};
|
||||
|
||||
uint64_t get_pdcp_optmask(void) {
|
||||
return pdcp_params.optmask;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
* If PDCP_UNIT_TEST is set here then data flow between PDCP and RLC is broken
|
||||
@@ -102,11 +102,9 @@ boolean_t pdcp_data_req(
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
unsigned char *const sdu_buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,const uint32_t *const sourceL2Id
|
||||
,const uint32_t *const destinationL2Id
|
||||
#endif
|
||||
const pdcp_transmission_mode_t modeP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
@@ -183,11 +181,13 @@ boolean_t pdcp_data_req(
|
||||
|
||||
if (pdcp_pdu_p != NULL) {
|
||||
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
|
||||
#if defined(DEBUG_PDCP_PAYLOAD)
|
||||
rlc_util_print_hex_octets(PDCP,
|
||||
(unsigned char *)&pdcp_pdu_p->data[0],
|
||||
sdu_buffer_sizeP);
|
||||
#endif
|
||||
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
rlc_util_print_hex_octets(PDCP,
|
||||
(unsigned char *)&pdcp_pdu_p->data[0],
|
||||
sdu_buffer_sizeP);
|
||||
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
|
||||
}
|
||||
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
|
||||
@@ -200,20 +200,13 @@ boolean_t pdcp_data_req(
|
||||
} else {
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
|
||||
confirmP, sdu_buffer_sizeP, pdcp_pdu_p
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,NULL, NULL
|
||||
#endif
|
||||
);
|
||||
}
|
||||
} else {
|
||||
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
|
||||
LOG_W(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
LOG_E(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP));
|
||||
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
|
||||
AssertFatal(0, PROTOCOL_CTXT_FMT"[RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
rb_idP);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
// calculate the pdcp header and trailer size
|
||||
@@ -314,8 +307,6 @@ boolean_t pdcp_data_req(
|
||||
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i];
|
||||
}
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
|
||||
if ((pdcp_p->security_activated != 0) &&
|
||||
(((pdcp_p->cipheringAlgorithm) != 0) ||
|
||||
((pdcp_p->integrityProtAlgorithm) != 0))) {
|
||||
@@ -341,7 +332,6 @@ boolean_t pdcp_data_req(
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Print octets of outgoing data in hexadecimal form */
|
||||
LOG_D(PDCP, "Following content with size %d will be sent over RLC (PDCP PDU header is the first two bytes)\n",
|
||||
pdcp_pdu_size);
|
||||
@@ -356,14 +346,11 @@ boolean_t pdcp_data_req(
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].data_req);
|
||||
}
|
||||
|
||||
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
|
||||
AssertFatal(0, "[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
ctxt_pP->frame,
|
||||
(ctxt_pP->enb_flag) ? "eNB" : "UE",
|
||||
ctxt_pP->enb_module_id,
|
||||
ctxt_pP->ue_module_id,
|
||||
rb_idP);
|
||||
#endif
|
||||
LOG_E(PDCP, "[FRAME %5u][%s][PDCP][MOD %u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
|
||||
ctxt_pP->frame,
|
||||
(ctxt_pP->enb_flag) ? "eNB" : "UE",
|
||||
ctxt_pP->module_id,
|
||||
rb_idP);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -374,9 +361,6 @@ boolean_t pdcp_data_req(
|
||||
*/
|
||||
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)pdcp_pdu_p->data,pdcp_pdu_size,
|
||||
"[MSG] PDCP DL %s PDU on rb_id %d\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP);
|
||||
|
||||
#ifndef UETARGET
|
||||
|
||||
|
||||
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1))
|
||||
{
|
||||
@@ -384,17 +368,17 @@ boolean_t pdcp_data_req(
|
||||
LOG_D(PDCP, "pdcp data req on drb %d, size %d, rnti %x, node_type %d \n",
|
||||
rb_idP, pdcp_pdu_size, ctxt_pP->rnti, RC.rrc[ctxt_pP->module_id]->node_type);
|
||||
|
||||
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
|
||||
/* currently, there is no support to send also the source/destinationL2Id */
|
||||
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
||||
/* assume good status */
|
||||
rlc_status = RLC_OP_STATUS_OK;
|
||||
ret = TRUE;
|
||||
LOG_D(PDCP, "proto_agent_send_rlc_data_req for UE RNTI %x, rb %d, pdu size %d \n",
|
||||
ctxt_pP->rnti, rb_idP, pdcp_pdu_size);
|
||||
if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_ng_eNB_CU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_CU) {
|
||||
/* currently, there is no support to send also the source/destinationL2Id */
|
||||
proto_agent_send_rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
||||
/* assume good status */
|
||||
rlc_status = RLC_OP_STATUS_OK;
|
||||
ret = TRUE;
|
||||
LOG_D(PDCP, "proto_agent_send_rlc_data_req for UE RNTI %x, rb %d, pdu size %d \n",
|
||||
ctxt_pP->rnti, rb_idP, pdcp_pdu_size);
|
||||
|
||||
} else if (RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_DU
|
||||
|| RC.rrc[ctxt_pP->module_id]->node_type == ngran_gNB_DU){
|
||||
@@ -404,11 +388,8 @@ boolean_t pdcp_data_req(
|
||||
else {
|
||||
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,sourceL2Id
|
||||
,destinationL2Id
|
||||
#endif
|
||||
confirmP, pdcp_pdu_size, pdcp_pdu_p, sourceL2Id,
|
||||
destinationL2Id
|
||||
);
|
||||
switch (rlc_status) {
|
||||
case RLC_OP_STATUS_OK:
|
||||
@@ -441,7 +422,6 @@ boolean_t pdcp_data_req(
|
||||
rlc_status = ack_result;
|
||||
}
|
||||
else // SRB
|
||||
#endif /*UETARGET*/
|
||||
{
|
||||
|
||||
if ((RC.rrc[ctxt_pP->module_id]->node_type == ngran_eNB_CU) ||
|
||||
@@ -564,11 +544,12 @@ pdcp_data_ind(
|
||||
hashtable_rc_t h_rc;
|
||||
uint8_t rb_offset= (srb_flagP == 0) ? DTCH -1 :0;
|
||||
uint16_t pdcp_uid=0;
|
||||
uint8_t oo_flag=0;
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
MessageDef *message_p = NULL;
|
||||
uint8_t *gtpu_buffer_p = NULL;
|
||||
#endif
|
||||
uint32_t rx_hfn_for_count;
|
||||
int pdcp_sn_for_count;
|
||||
int security_ok;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_IN);
|
||||
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP,
|
||||
"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
|
||||
@@ -599,7 +580,7 @@ pdcp_data_ind(
|
||||
LOG_D(PDCP, "Data indication notification for PDCP entity from UE %x to eNB %u "
|
||||
"and radio bearer ID %d rlc sdu size %d ctxt_pP->enb_flag %d\n",
|
||||
ctxt_pP->rnti,
|
||||
ctxt_pP->module_id ,
|
||||
ctxt_pP->module_id,
|
||||
rb_idP,
|
||||
sdu_buffer_sizeP,
|
||||
ctxt_pP->enb_flag);
|
||||
@@ -656,10 +637,10 @@ pdcp_data_ind(
|
||||
} else { // DRB
|
||||
pdcp_tailer_len = 0;
|
||||
|
||||
if (pdcp_p->seq_num_size == PDCP_SN_7BIT) {
|
||||
if (pdcp_p->seq_num_size == 7) {
|
||||
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_SHORT_SN_HEADER_SIZE;
|
||||
sequence_number = pdcp_get_sequence_number_of_pdu_with_short_sn((unsigned char *)sdu_buffer_pP->data);
|
||||
} else if (pdcp_p->seq_num_size == PDCP_SN_12BIT) {
|
||||
} else if (pdcp_p->seq_num_size == 12) {
|
||||
pdcp_header_len = PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
|
||||
sequence_number = pdcp_get_sequence_number_of_pdu_with_long_sn((unsigned char *)sdu_buffer_pP->data);
|
||||
} else {
|
||||
@@ -668,6 +649,7 @@ pdcp_data_ind(
|
||||
PROTOCOL_PDCP_CTXT_FMT"wrong sequence number (%d) for this pdcp entity \n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
|
||||
pdcp_p->seq_num_size);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
//uint8_t dc = pdcp_get_dc_filed((unsigned char*)sdu_buffer_pP->data);
|
||||
@@ -693,6 +675,8 @@ pdcp_data_ind(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Removed by Cedric */
|
||||
if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) {
|
||||
LOG_T(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number);
|
||||
/* if (dc == PDCP_DATA_PDU )
|
||||
@@ -700,8 +684,8 @@ pdcp_data_ind(
|
||||
else
|
||||
LOG_D(PDCP, "Passing piggybacked SDU to RRC ...\n");*/
|
||||
} else {
|
||||
oo_flag=1;
|
||||
LOG_W(PDCP,
|
||||
Pdcp_stats_rx_outoforder[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
|
||||
LOG_E(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"Incoming PDU has an unexpected sequence number (%d), RX window synchronisation have probably been lost!\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
|
||||
sequence_number);
|
||||
@@ -713,10 +697,18 @@ pdcp_data_ind(
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
// SRB1/2: control-plane data
|
||||
if (srb_flagP) {
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* process as described in 36.323 5.1.2.2 */
|
||||
if (sequence_number < pdcp_p->next_pdcp_rx_sn) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn + 1;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
} else {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
@@ -725,23 +717,45 @@ pdcp_data_ind(
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
pdcp_validate_security(ctxt_pP,
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
sequence_number,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len);
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDCP SRB PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (sequence_number < pdcp_p->next_pdcp_rx_sn)
|
||||
pdcp_p->rx_hfn++;
|
||||
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
|
||||
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
#endif
|
||||
//rrc_lite_data_ind(module_id, //Modified MW - L2 Interface
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_NO)? MSC_PDCP_UE:MSC_PDCP_ENB,
|
||||
@@ -765,13 +779,58 @@ pdcp_data_ind(
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND,VCD_FUNCTION_OUT);
|
||||
return TRUE;
|
||||
}
|
||||
} /* if (srb_flagP) */
|
||||
|
||||
/*
|
||||
* DRBs
|
||||
*/
|
||||
payload_offset=pdcp_header_len;// PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
|
||||
#if defined(ENABLE_SECURITY)
|
||||
|
||||
switch (pdcp_p->rlc_mode) {
|
||||
case RLC_MODE_AM: {
|
||||
/* process as described in 36.323 5.1.2.1.2 */
|
||||
int reordering_window;
|
||||
|
||||
if (pdcp_p->seq_num_size == 7)
|
||||
reordering_window = REORDERING_WINDOW_SN_7BIT;
|
||||
else
|
||||
reordering_window = REORDERING_WINDOW_SN_12BIT;
|
||||
|
||||
if (sequence_number - pdcp_p->last_submitted_pdcp_rx_sn > reordering_window ||
|
||||
(pdcp_p->last_submitted_pdcp_rx_sn - sequence_number >= 0 &&
|
||||
pdcp_p->last_submitted_pdcp_rx_sn - sequence_number < reordering_window)) {
|
||||
/* TODO: specs say to decipher and do header decompression */
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"discard PDU, out of\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
|
||||
} else if (pdcp_p->next_pdcp_rx_sn - sequence_number > reordering_window) {
|
||||
pdcp_p->rx_hfn++;
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
|
||||
} else if (sequence_number - pdcp_p->next_pdcp_rx_sn >= reordering_window) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn - 1;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
|
||||
} else if (sequence_number >= pdcp_p->next_pdcp_rx_sn) {
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
} else { /* sequence_number < pdcp_p->next_pdcp_rx_sn */
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
@@ -780,25 +839,108 @@ pdcp_data_ind(
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
pdcp_validate_security(
|
||||
ctxt_pP,
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
sequence_number,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len);
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/AM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* TODO: specs say we have to store this PDU in a list and then deliver
|
||||
* stored packets to upper layers according to a well defined
|
||||
* procedure. The code below that deals with delivery is today
|
||||
* too complex to do this properly, so we only send the current
|
||||
* received packet. This is not correct and has to be fixed
|
||||
* some day.
|
||||
* In the meantime, let's pretend the last submitted PDCP SDU
|
||||
* is the current one.
|
||||
* TODO: we also have to deal with re-establishment PDU (control PDUs)
|
||||
* that contain no SDU.
|
||||
*/
|
||||
|
||||
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
|
||||
|
||||
break;
|
||||
} /* case RLC_MODE_AM */
|
||||
|
||||
case RLC_MODE_UM:
|
||||
/* process as described in 36.323 5.1.2.1.3 */
|
||||
if (sequence_number < pdcp_p->next_pdcp_rx_sn) {
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
rx_hfn_for_count = pdcp_p->rx_hfn;
|
||||
pdcp_sn_for_count = sequence_number;
|
||||
pdcp_p->next_pdcp_rx_sn = sequence_number + 1;
|
||||
if (pdcp_p->next_pdcp_rx_sn > pdcp_p->maximum_pdcp_rx_sn) {
|
||||
pdcp_p->next_pdcp_rx_sn = 0;
|
||||
pdcp_p->rx_hfn++;
|
||||
}
|
||||
|
||||
if (pdcp_p->security_activated == 1) {
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
start_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
|
||||
security_ok = pdcp_validate_security(ctxt_pP,
|
||||
pdcp_p,
|
||||
srb_flagP,
|
||||
rb_idP,
|
||||
pdcp_header_len,
|
||||
rx_hfn_for_count,
|
||||
pdcp_sn_for_count,
|
||||
sdu_buffer_pP->data,
|
||||
sdu_buffer_sizeP - pdcp_tailer_len) == 0;
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
} else {
|
||||
stop_meas(&UE_pdcp_stats[ctxt_pP->module_id].validate_security);
|
||||
}
|
||||
} else {
|
||||
security_ok = 1;
|
||||
}
|
||||
|
||||
if (security_ok == 0) {
|
||||
LOG_W(PDCP,
|
||||
PROTOCOL_PDCP_CTXT_FMT"security not validated for incoming PDPC DRB RLC/UM PDU\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p));
|
||||
LOG_W(PDCP, "Ignoring PDU...\n");
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* TODO: indicate integrity verification failure to upper layer */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_E(PDCP, "bad RLC mode, cannot happen.\n");
|
||||
exit(1);
|
||||
} /* switch (pdcp_p->rlc_mode) */
|
||||
} else { /* MBMS_flagP == 0 */
|
||||
payload_offset=0;
|
||||
}
|
||||
|
||||
@@ -823,8 +965,8 @@ pdcp_data_ind(
|
||||
* from its second byte (skipping 0th and 1st octets, i.e.
|
||||
* PDCP header)
|
||||
*/
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U) {
|
||||
if ((TRUE == ctxt_pP->enb_flag) && (FALSE == srb_flagP)) {
|
||||
LOG_D(PDCP, "Sending packet to GTP, Calling GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u\n",
|
||||
ctxt_pP->rnti,
|
||||
@@ -854,10 +996,10 @@ pdcp_data_ind(
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
|
||||
#else
|
||||
} else {
|
||||
packet_forwarded = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MBMS_MULTICAST_OUT
|
||||
|
||||
if ((MBMS_flagP != 0) && (mbms_socket != -1)) {
|
||||
@@ -892,39 +1034,45 @@ pdcp_data_ind(
|
||||
// set ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst for IP layer here
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id;
|
||||
#if defined(ENABLE_USE_MME)
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* for the UE compiled in S1 mode, we need 1 here
|
||||
* for the UE compiled in noS1 mode, we need 0
|
||||
* TODO: be sure of this
|
||||
*/
|
||||
if (nfapi_mode == 3) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
|
||||
if (UE_NAS_USE_TUN) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
#endif
|
||||
} else { // nfapi_mode
|
||||
if (UE_NAS_USE_TUN) {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
} // nfapi_mode
|
||||
}
|
||||
} else {
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->rb_id = rb_id + (ctxt_pP->module_id * LTE_maxDRB);
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
}
|
||||
|
||||
// new_sdu_p->data->inst is set again in UE case so move to above.
|
||||
//Panos: Commented this out because it cancels the assignment in #if defined(ENABLE_USE_MME) case
|
||||
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
|
||||
if( LOG_DEBUGFLAG(DEBUG_PDCP) ) {
|
||||
static uint32_t pdcp_inst = 0;
|
||||
((pdcp_data_ind_header_t *) new_sdu_p->data)->inst = pdcp_inst++;
|
||||
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t *) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
|
||||
#endif
|
||||
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; //pdcp_inst++;
|
||||
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], \
|
||||
&sdu_buffer_pP->data[payload_offset], \
|
||||
}
|
||||
|
||||
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)],
|
||||
&sdu_buffer_pP->data[payload_offset],
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
list_add_tail_eurecom (new_sdu_p, sdu_list_p);
|
||||
}
|
||||
@@ -960,10 +1108,6 @@ pdcp_data_ind(
|
||||
Pdcp_stats_rx_bytes_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(sdu_buffer_sizeP - payload_offset);
|
||||
|
||||
Pdcp_stats_rx_sn[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=sequence_number;
|
||||
|
||||
if (oo_flag == 1 )
|
||||
Pdcp_stats_rx_outoforder[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
|
||||
|
||||
Pdcp_stats_rx_aiat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
|
||||
Pdcp_stats_rx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+=(pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
|
||||
Pdcp_stats_rx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
|
||||
@@ -1049,7 +1193,6 @@ pdcp_run (
|
||||
pdcp_enb[ctxt_pP->module_id].subframe= ctxt_pP->subframe;
|
||||
pdcp_update_stats(ctxt_pP);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_RUN, VCD_FUNCTION_IN);
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
int result;
|
||||
protocol_ctxt_t ctxt;
|
||||
@@ -1086,10 +1229,8 @@ pdcp_run (
|
||||
RRC_DCCH_DATA_REQ (msg_p).confirmp,
|
||||
RRC_DCCH_DATA_REQ (msg_p).sdu_size,
|
||||
RRC_DCCH_DATA_REQ (msg_p).sdu_p,
|
||||
RRC_DCCH_DATA_REQ (msg_p).mode
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, NULL, NULL
|
||||
#endif
|
||||
RRC_DCCH_DATA_REQ (msg_p).mode,
|
||||
NULL, NULL
|
||||
);
|
||||
|
||||
if (result != TRUE)
|
||||
@@ -1126,13 +1267,8 @@ pdcp_run (
|
||||
}
|
||||
} while(msg_p != NULL);
|
||||
|
||||
#endif
|
||||
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
|
||||
if (ctxt_pP->enb_flag == ENB_FLAG_NO)
|
||||
#endif
|
||||
{
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
|
||||
pdcp_fifo_read_input_sdus(ctxt_pP);
|
||||
}
|
||||
|
||||
@@ -1282,11 +1418,9 @@ rrc_pdcp_config_asn1_req (
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
,LTE_PMCH_InfoList_r9_t *const pmch_InfoList_r9_pP
|
||||
#endif
|
||||
,rb_id_t *const defaultDRB
|
||||
uint8_t *const kUPenc_pP,
|
||||
LTE_PMCH_InfoList_r9_t *const pmch_InfoList_r9_pP,
|
||||
rb_id_t *const defaultDRB
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
@@ -1309,11 +1443,9 @@ rrc_pdcp_config_asn1_req (
|
||||
hashtable_rc_t h_rc;
|
||||
hash_key_t key_defaultDRB = HASHTABLE_NOT_A_KEY_VALUE;
|
||||
hashtable_rc_t h_defaultDRB_rc;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
int i,j;
|
||||
LTE_MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL;
|
||||
LTE_MBMS_SessionInfo_r9_t *MBMS_SessionInfo_p = NULL;
|
||||
#endif
|
||||
LOG_T(PDCP, PROTOCOL_CTXT_FMT" %s() SRB2ADD %p DRB2ADD %p DRB2RELEASE %p\n",
|
||||
PROTOCOL_CTXT_ARGS(ctxt_pP),
|
||||
__FUNCTION__,
|
||||
@@ -1603,8 +1735,6 @@ rrc_pdcp_config_asn1_req (
|
||||
}
|
||||
}
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
|
||||
if (pmch_InfoList_r9_pP != NULL) {
|
||||
for (i=0; i<pmch_InfoList_r9_pP->list.count; i++) {
|
||||
mbms_SessionInfoList_r9_p = &(pmch_InfoList_r9_pP->list.array[i]->mbms_SessionInfoList_r9);
|
||||
@@ -1666,7 +1796,6 @@ rrc_pdcp_config_asn1_req (
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1726,22 +1855,23 @@ pdcp_config_req_asn1 (
|
||||
pdcp_pP->status_report = rb_reportP;
|
||||
|
||||
if (rb_snP == LTE_PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits) {
|
||||
pdcp_pP->seq_num_size = PDCP_SN_12BIT;
|
||||
pdcp_pP->seq_num_size = 12;
|
||||
pdcp_pP->maximum_pdcp_rx_sn = (1 << 12) - 1;
|
||||
} else if (rb_snP == LTE_PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
||||
pdcp_pP->seq_num_size = PDCP_SN_7BIT;
|
||||
pdcp_pP->seq_num_size = 7;
|
||||
pdcp_pP->maximum_pdcp_rx_sn = (1 << 7) - 1;
|
||||
} else {
|
||||
pdcp_pP->seq_num_size = PDCP_SN_5BIT;
|
||||
pdcp_pP->seq_num_size = 5;
|
||||
pdcp_pP->maximum_pdcp_rx_sn = (1 << 5) - 1;
|
||||
}
|
||||
|
||||
pdcp_pP->rlc_mode = rlc_modeP;
|
||||
pdcp_pP->next_pdcp_tx_sn = 0;
|
||||
pdcp_pP->next_pdcp_rx_sn = 0;
|
||||
pdcp_pP->next_pdcp_rx_sn_before_integrity = 0;
|
||||
pdcp_pP->tx_hfn = 0;
|
||||
pdcp_pP->rx_hfn = 0;
|
||||
pdcp_pP->last_submitted_pdcp_rx_sn = 4095;
|
||||
pdcp_pP->first_missing_pdu = -1;
|
||||
pdcp_pP->rx_hfn_offset = 0;
|
||||
LOG_I(PDCP, PROTOCOL_PDCP_CTXT_FMT" Action ADD LCID %d (%s id %d) "
|
||||
"configured with SN size %d bits and RLC %s\n",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
|
||||
@@ -1830,7 +1960,6 @@ pdcp_config_req_asn1 (
|
||||
|
||||
memset(pdcp_pP, 0, sizeof(pdcp_t));
|
||||
break;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
case CONFIG_ACTION_MBMS_ADD:
|
||||
case CONFIG_ACTION_MBMS_MODIFY:
|
||||
@@ -1850,7 +1979,6 @@ pdcp_config_req_asn1 (
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
case CONFIG_ACTION_SET_SECURITY_MODE:
|
||||
pdcp_config_set_security(
|
||||
@@ -2061,39 +2189,28 @@ rrc_pdcp_config_req (
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
pdcp_module_init (
|
||||
void
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef PDCP_USE_RT_FIFO
|
||||
int ret;
|
||||
ret=rtf_create(PDCP2NW_DRIVER_FIFO,32768);
|
||||
|
||||
if (ret < 0) {
|
||||
LOG_E(PDCP, "Cannot create PDCP2NW_DRIVER_FIFO fifo %d (ERROR %d)\n", PDCP2NW_DRIVER_FIFO, ret);
|
||||
return -1;
|
||||
} else {
|
||||
LOG_D(PDCP, "Created PDCP2NAS fifo %d\n", PDCP2NW_DRIVER_FIFO);
|
||||
rtf_reset(PDCP2NW_DRIVER_FIFO);
|
||||
uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
|
||||
/* temporary enforce netlink when UE_NAS_USE_TUN is set,
|
||||
this is while switching from noS1 as build option
|
||||
to noS1 as config option */
|
||||
if ( pdcp_optmask & UE_NAS_USE_TUN_BIT) {
|
||||
pdcp_params.optmask = pdcp_params.optmask | PDCP_USE_NETLINK_BIT ;
|
||||
}
|
||||
|
||||
ret=rtf_create(NW_DRIVER2PDCP_FIFO,32768);
|
||||
pdcp_params.optmask = pdcp_params.optmask | pdcp_optmask ;
|
||||
LOG_I(PDCP, "pdcp init,%s %s\n",
|
||||
((LINK_ENB_PDCP_TO_GTPV1U)?"usegtp":""),
|
||||
((PDCP_USE_NETLINK)?"usenetlink":""));
|
||||
|
||||
if (ret < 0) {
|
||||
LOG_E(PDCP, "Cannot create NW_DRIVER2PDCP_FIFO fifo %d (ERROR %d)\n", NW_DRIVER2PDCP_FIFO, ret);
|
||||
return -1;
|
||||
if (PDCP_USE_NETLINK) {
|
||||
if(UE_NAS_USE_TUN) {
|
||||
netlink_init_tun();
|
||||
} else {
|
||||
LOG_D(PDCP, "Created NW_DRIVER2PDCP_FIFO fifo %d\n", NW_DRIVER2PDCP_FIFO);
|
||||
rtf_reset(NW_DRIVER2PDCP_FIFO);
|
||||
netlink_init();
|
||||
}
|
||||
}
|
||||
|
||||
pdcp_2_nas_irq = 0;
|
||||
pdcp_input_sdu_remaining_size_to_read=0;
|
||||
pdcp_input_sdu_size_read=0;
|
||||
#endif
|
||||
return 0;
|
||||
return pdcp_params.optmask ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -2127,10 +2244,6 @@ pdcp_free (
|
||||
void pdcp_module_cleanup (void)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
#ifdef PDCP_USE_RT_FIFO
|
||||
rtf_destroy(NW_DRIVER2PDCP_FIFO);
|
||||
rtf_destroy(PDCP2NW_DRIVER_FIFO);
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -2139,10 +2252,8 @@ void pdcp_layer_init(void)
|
||||
{
|
||||
module_id_t instance;
|
||||
int i,j;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
mbms_session_id_t session_id;
|
||||
mbms_service_id_t service_id;
|
||||
#endif
|
||||
/*
|
||||
* Initialize SDU list
|
||||
*/
|
||||
@@ -2151,30 +2262,23 @@ void pdcp_layer_init(void)
|
||||
AssertFatal(pdcp_coll_p != NULL, "UNRECOVERABLE error, PDCP hashtable_create failed");
|
||||
|
||||
for (instance = 0; instance < MAX_MOBILES_PER_ENB; instance++) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
for (service_id = 0; service_id < LTE_maxServiceCount; service_id++) {
|
||||
for (session_id = 0; session_id < LTE_maxSessionPerPMCH; session_id++) {
|
||||
memset(&pdcp_mbms_array_ue[instance][service_id][session_id], 0, sizeof(pdcp_mbms_t));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
pdcp_eNB_UE_instance_to_rnti[instance] = NOT_A_RNTI;
|
||||
}
|
||||
|
||||
pdcp_eNB_UE_instance_to_rnti_index = 0;
|
||||
|
||||
for (instance = 0; instance < NUMBER_OF_eNB_MAX; instance++) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
for (service_id = 0; service_id < LTE_maxServiceCount; service_id++) {
|
||||
for (session_id = 0; session_id < LTE_maxSessionPerPMCH; session_id++) {
|
||||
memset(&pdcp_mbms_array_eNB[instance][service_id][session_id], 0, sizeof(pdcp_mbms_t));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MBMS_MULTICAST_OUT
|
||||
@@ -2236,7 +2340,3 @@ void pdcp_layer_cleanup (void)
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef PDCP_USE_RT_FIFO
|
||||
EXPORT_SYMBOL(pdcp_2_nas_irq);
|
||||
#endif //PDCP_USE_RT_FIFO
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
# define __PDCP_H__
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifndef NON_ACCESS_STRATUM
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#endif //NON_ACCESS_STRATUM
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
@@ -47,10 +47,23 @@
|
||||
#include "LTE_SRB-ToAddMod.h"
|
||||
#include "LTE_SRB-ToAddModList.h"
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
#include "LTE_MBMS-SessionInfoList-r9.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#include "LTE_MBMS-SessionInfoList-r9.h"
|
||||
#include "LTE_PMCH-InfoList-r9.h"
|
||||
#endif
|
||||
|
||||
#define PDCP_USE_NETLINK_BIT (1<< 11)
|
||||
#define LINK_ENB_PDCP_TO_IP_DRIVER_BIT (1<< 13)
|
||||
#define LINK_ENB_PDCP_TO_GTPV1U_BIT (1<< 14)
|
||||
#define UE_NAS_USE_TUN_BIT (1<< 15)
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
} pdcp_params_t;
|
||||
|
||||
#define PDCP_USE_NETLINK ( get_pdcp_optmask() & PDCP_USE_NETLINK_BIT)
|
||||
#define LINK_ENB_PDCP_TO_IP_DRIVER ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_IP_DRIVER_BIT)
|
||||
#define LINK_ENB_PDCP_TO_GTPV1U ( get_pdcp_optmask() & LINK_ENB_PDCP_TO_GTPV1U_BIT)
|
||||
#define UE_NAS_USE_TUN ( get_pdcp_optmask() & UE_NAS_USE_TUN_BIT)
|
||||
uint64_t get_pdcp_optmask(void);
|
||||
|
||||
extern pthread_t pdcp_thread;
|
||||
extern pthread_attr_t pdcp_thread_attr;
|
||||
@@ -95,7 +108,7 @@ uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_iat[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
uint32_t Pdcp_stats_rx_outoforder[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
|
||||
|
||||
void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctxt_pP);
|
||||
void pdcp_update_perioidical_stats(const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
|
||||
/*Packet Probing for agent PDCP*/
|
||||
@@ -164,13 +177,12 @@ typedef struct pdcp_s {
|
||||
*/
|
||||
pdcp_sn_t next_pdcp_tx_sn;
|
||||
pdcp_sn_t next_pdcp_rx_sn;
|
||||
pdcp_sn_t next_pdcp_rx_sn_before_integrity;
|
||||
pdcp_sn_t maximum_pdcp_rx_sn;
|
||||
/*
|
||||
* TX and RX Hyper Frame Numbers
|
||||
*/
|
||||
pdcp_hfn_t tx_hfn;
|
||||
pdcp_hfn_t rx_hfn;
|
||||
pdcp_hfn_offset_t rx_hfn_offset; // related to sn mismatch
|
||||
|
||||
/*
|
||||
* SN of the last PDCP SDU delivered to upper layers
|
||||
@@ -224,19 +236,19 @@ typedef struct pdcp_mbms_s {
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
boolean_t pdcp_data_req(
|
||||
protocol_ctxt_t* ctxt_pP,
|
||||
protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP, \
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char* const sdu_buffer,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,const uint32_t * const sourceL2Id
|
||||
,const uint32_t * const destinationL2Id
|
||||
,const uint32_t *const sourceL2Id
|
||||
,const uint32_t *const destinationL2Id
|
||||
#endif
|
||||
);
|
||||
);
|
||||
|
||||
/*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t)
|
||||
* \brief This functions handles data transfer indications coming from RLC
|
||||
@@ -252,12 +264,12 @@ boolean_t pdcp_data_req(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
boolean_t pdcp_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
mem_block_t* const sdu_buffer);
|
||||
mem_block_t *const sdu_buffer);
|
||||
|
||||
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
|
||||
* \brief This functions initializes relevant PDCP entity
|
||||
@@ -270,7 +282,7 @@ boolean_t pdcp_data_ind(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
void rrc_pdcp_config_req (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint32_t actionP,
|
||||
const rb_id_t rb_idP,
|
||||
@@ -291,7 +303,7 @@ void rrc_pdcp_config_req (
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
boolean_t rrc_pdcp_config_asn1_req (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_SRB_ToAddModList_t *const srb2add_list,
|
||||
LTE_DRB_ToAddModList_t *const drb2add_list,
|
||||
LTE_DRB_ToReleaseList_t *const drb2release_list,
|
||||
@@ -303,7 +315,7 @@ boolean_t rrc_pdcp_config_asn1_req (
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
#endif
|
||||
,rb_id_t *const defaultDRB
|
||||
);
|
||||
);
|
||||
|
||||
/*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode)
|
||||
* \brief Function for RRC to configure a Radio Bearer.
|
||||
@@ -326,7 +338,7 @@ boolean_t rrc_pdcp_config_asn1_req (
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
boolean_t pdcp_config_req_asn1 (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rlc_mode_t rlc_mode,
|
||||
@@ -347,7 +359,7 @@ boolean_t pdcp_config_req_asn1 (
|
||||
* \param[in] ctxt_pP Running context.
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP);
|
||||
void pdcp_add_UE(const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
/*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP)
|
||||
* \brief Function for RRC to remove UE from PDCP module hashtable
|
||||
@@ -355,7 +367,7 @@ void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP);
|
||||
* \return A status about the processing, OK or error code.
|
||||
*/
|
||||
boolean_t pdcp_remove_UE(
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
/*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t)
|
||||
* \brief This functions is unused
|
||||
@@ -375,22 +387,18 @@ boolean_t pdcp_remove_UE(
|
||||
* @ingroup _pdcp
|
||||
*/
|
||||
void pdcp_run (
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
int pdcp_module_init (void);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
uint64_t pdcp_module_init (uint64_t pdcp_optmask);
|
||||
void pdcp_module_cleanup (void);
|
||||
void pdcp_layer_init (void);
|
||||
void pdcp_layer_cleanup (void);
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
int pdcp_netlink_init (void);
|
||||
|
||||
#endif
|
||||
#define PDCP2NW_DRIVER_FIFO 21
|
||||
#define NW_DRIVER2PDCP_FIFO 22
|
||||
|
||||
int pdcp_fifo_flush_sdus ( const protocol_ctxt_t* const ctxt_pP);
|
||||
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t* const ctxt_pP);
|
||||
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t* const ctxt_pP);
|
||||
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t* const ctxt_pP);
|
||||
int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ctxt_pP);
|
||||
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
|
||||
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP);
|
||||
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -479,29 +487,18 @@ typedef struct {
|
||||
#define REORDERING_WINDOW_SN_7BIT 64
|
||||
#define REORDERING_WINDOW_SN_12BIT 2048
|
||||
|
||||
/*
|
||||
* SN size
|
||||
*/
|
||||
#define PDCP_SN_5BIT 5
|
||||
#define PDCP_SN_7BIT 7
|
||||
#define PDCP_SN_12BIT 12
|
||||
|
||||
|
||||
signed int pdcp_2_nas_irq;
|
||||
pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];
|
||||
pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];
|
||||
//pdcp_t pdcp_array_srb_ue[MAX_MOBILES_PER_ENB][2];
|
||||
//pdcp_t pdcp_array_drb_ue[MAX_MOBILES_PER_ENB][maxDRB];
|
||||
//pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][2];
|
||||
//pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][maxDRB];
|
||||
|
||||
|
||||
// for UE code conly
|
||||
rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
|
||||
rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode
|
||||
unsigned int pdcp_eNB_UE_instance_to_rnti_index;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][LTE_maxServiceCount][LTE_maxSessionPerPMCH]; // some constants from openair2/RRC/LTE/MESSAGES/asn1_constants.h
|
||||
#endif
|
||||
sdu_size_t pdcp_output_sdu_bytes_to_write;
|
||||
sdu_size_t pdcp_output_header_bytes_to_write;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@
|
||||
|
||||
/* Bugfix for version of GCC = 4.4.3 (Ubuntu 10.04) */
|
||||
#if GCC_VERSION <= 40403
|
||||
# include <sys/socket.h>
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#include <linux/netlink.h>
|
||||
@@ -70,7 +70,7 @@ extern struct iovec nas_iov_rx;
|
||||
extern int nas_sock_fd;
|
||||
extern struct msghdr nas_msg_rx;
|
||||
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
|
||||
static pthread_t pdcp_netlink_thread;
|
||||
|
||||
/* We use lock-free queues between the User-plane driver running in kernel-space
|
||||
@@ -93,41 +93,37 @@ pdcp_netlink_init(
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
int i;
|
||||
int nb_inst_enb;
|
||||
int nb_inst_ue;
|
||||
pthread_attr_t attr;
|
||||
struct sched_param sched_param;
|
||||
|
||||
reset_meas(&ip_pdcp_stats_tmp);
|
||||
nb_inst_enb = 1;
|
||||
nb_inst_ue = 1;
|
||||
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
nb_inst_enb = 0;
|
||||
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
|
||||
#else
|
||||
#warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues"
|
||||
pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state*));
|
||||
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
|
||||
LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
|
||||
if (LINK_ENB_PDCP_TO_GTPV1U) {
|
||||
nb_inst_enb = 0;
|
||||
LOG_I(PDCP, "[NETLINK] Creating 0 queues for eNB Netlink -> PDCP communication\n");
|
||||
} else {
|
||||
/* #warning " LG: When there will be handover in, there will problems because dim is based on local nums of ues" */
|
||||
pdcp_netlink_queue_enb = calloc(nb_inst_enb, sizeof(struct lfds611_queue_state *));
|
||||
pdcp_netlink_nb_element_enb = malloc(nb_inst_enb * sizeof(uint32_t));
|
||||
LOG_I(PDCP, "[NETLINK] Creating %d queues for eNB Netlink -> PDCP communication\n", nb_inst_enb);
|
||||
|
||||
for (i = 0; i < nb_inst_enb; i++) {
|
||||
pdcp_netlink_nb_element_enb[i] = 0;
|
||||
for (i = 0; i < nb_inst_enb; i++) {
|
||||
pdcp_netlink_nb_element_enb[i] = 0;
|
||||
|
||||
if (lfds611_queue_new(&pdcp_netlink_queue_enb[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
|
||||
LOG_E(PDCP, "Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d\n", i);
|
||||
exit(EXIT_FAILURE);
|
||||
if (lfds611_queue_new(&pdcp_netlink_queue_enb[i], PDCP_QUEUE_NB_ELEMENTS) < 0) {
|
||||
LOG_E(PDCP, "Failed to create new FIFO for eNB Netlink -> PDCP communcation instance %d\n", i);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (nb_inst_ue > 0) {
|
||||
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state*));
|
||||
pdcp_netlink_queue_ue = calloc(nb_inst_ue, sizeof(struct lfds611_queue_state *));
|
||||
pdcp_netlink_nb_element_ue = malloc(nb_inst_ue * sizeof(uint32_t));
|
||||
|
||||
LOG_I(PDCP, "[NETLINK] Creating %d queues for UE Netlink -> PDCP communication\n", nb_inst_ue);
|
||||
|
||||
for (i = 0; i < nb_inst_ue; i++) {
|
||||
@@ -148,7 +144,6 @@ pdcp_netlink_init(
|
||||
}
|
||||
|
||||
sched_param.sched_priority = 10;
|
||||
|
||||
pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
||||
pthread_attr_setschedparam(&attr, &sched_param);
|
||||
|
||||
@@ -171,21 +166,21 @@ pdcp_netlink_init(
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
pdcp_netlink_dequeue_element(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
struct pdcp_netlink_element_s** data_ppP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
struct pdcp_netlink_element_s **data_ppP
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (ctxt_pP->enb_flag) {
|
||||
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->module_id], (void**)data_ppP);
|
||||
ret = lfds611_queue_dequeue(pdcp_netlink_queue_enb[ctxt_pP->module_id], (void **)data_ppP);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_D(PDCP,"[NETLINK]De-queueing packet for eNB instance %d\n", ctxt_pP->module_id);
|
||||
}
|
||||
} else {
|
||||
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->module_id], (void**)data_ppP);
|
||||
ret = lfds611_queue_dequeue(pdcp_netlink_queue_ue[ctxt_pP->module_id], (void **)data_ppP);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_D(PDCP, "[NETLINK]De-queueing packet for UE instance %d\n", ctxt_pP->module_id);
|
||||
@@ -209,8 +204,8 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
|
||||
LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
|
||||
MSC_START_USE();
|
||||
while (1) {
|
||||
|
||||
while (1) {
|
||||
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
|
||||
|
||||
if (len == 0) {
|
||||
@@ -248,7 +243,7 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
new_data_p->pdcp_read_header.data_size);
|
||||
} else {
|
||||
LOG_E(PDCP, "[NETLINK_THREAD] WRONG size %d should be sizeof "
|
||||
"%d ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
|
||||
"%lu ((pdcp_data_req_header_t) + sizeof(struct nlmsghdr))\n",
|
||||
nas_nlh_rx->nlmsg_len,
|
||||
sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
|
||||
}
|
||||
@@ -262,12 +257,11 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
if (eNB_flag) {
|
||||
if (pdcp_netlink_nb_element_enb[module_id]
|
||||
> PDCP_QUEUE_NB_ELEMENTS) {
|
||||
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%d)\n",
|
||||
module_id, pdcp_netlink_nb_element_enb);
|
||||
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in eNB pdcp queue (%lu)\n",
|
||||
module_id, (intptr_t)pdcp_netlink_nb_element_enb);
|
||||
}
|
||||
|
||||
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for eNB module id %d\n", module_id);
|
||||
|
||||
/* Enqueue the element in the right queue */
|
||||
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_enb[module_id], new_data_p);
|
||||
stop_meas(&ip_pdcp_stats_tmp);
|
||||
@@ -275,12 +269,11 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
} else {
|
||||
if (pdcp_netlink_nb_element_ue[module_id]
|
||||
> PDCP_QUEUE_NB_ELEMENTS) {
|
||||
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%d)\n",
|
||||
module_id, pdcp_netlink_nb_element_ue);
|
||||
LOG_E(PDCP, "[NETLINK_THREAD][Mod %02x] We reached maximum number of elements in UE pdcp queue (%lu)\n",
|
||||
module_id, (intptr_t)pdcp_netlink_nb_element_ue);
|
||||
}
|
||||
|
||||
LOG_I(PDCP,"[NETLINK_THREAD] IP->PDCP : En-queueing packet for UE module id %d\n", module_id);
|
||||
|
||||
/* Enqueue the element in the right queue */
|
||||
lfds611_queue_guaranteed_enqueue(pdcp_netlink_queue_ue[module_id], new_data_p);
|
||||
stop_meas(&ip_pdcp_stats_tmp);
|
||||
@@ -293,4 +286,4 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -173,7 +173,6 @@ int pdcp_netlink_dequeue_element(const protocol_ctxt_t* const ctxt_pP,
|
||||
void pdcp_config_set_security(const protocol_ctxt_t* const ctxt_pP, pdcp_t *pdcp_pP, rb_id_t rb_idP,
|
||||
uint16_t lc_idP, uint8_t security_modeP, uint8_t *kRRCenc_pP, uint8_t *kRRCint_pP, uint8_t *kUPenc_pP);
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
int pdcp_apply_security(const protocol_ctxt_t* const ctxt_pP,
|
||||
pdcp_t *pdcp_entity,
|
||||
srb_flag_t srb_flagP,
|
||||
@@ -188,10 +187,10 @@ int pdcp_validate_security(const protocol_ctxt_t* const ctxt_pP,
|
||||
srb_flag_t srb_flagP,
|
||||
rb_id_t rb_id,
|
||||
uint8_t pdcp_header_len,
|
||||
uint16_t current_sn,
|
||||
uint32_t hfn,
|
||||
int sn,
|
||||
uint8_t *pdcp_pdu_buffer,
|
||||
uint16_t sdu_buffer_size);
|
||||
#endif /* defined(ENABLE_SECURITY) */
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -40,13 +40,6 @@
|
||||
#include "msc.h"
|
||||
#include "pdcp_primitives.h"
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
|
||||
static
|
||||
uint32_t pdcp_get_next_count_tx(pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
|
||||
static
|
||||
uint32_t pdcp_get_next_count_rx(pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP, const uint16_t pdcp_sn);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static
|
||||
uint32_t pdcp_get_next_count_tx(
|
||||
@@ -79,26 +72,25 @@ static
|
||||
uint32_t pdcp_get_next_count_rx(
|
||||
pdcp_t * const pdcp_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const uint16_t pdcp_sn)
|
||||
const uint32_t hfn,
|
||||
const int sn)
|
||||
{
|
||||
uint32_t count;
|
||||
|
||||
/* For RX COUNT = RX_HFN << length of SN | pdcp SN of received PDU */
|
||||
if (srb_flagP) {
|
||||
/* 5 bits length SN */
|
||||
count = (((pdcp_pP->rx_hfn + pdcp_pP->rx_hfn_offset) << 5) | (pdcp_sn & 0x001F));
|
||||
count = (hfn << 5) | (sn & 0x001F);
|
||||
} else {
|
||||
if (pdcp_pP->seq_num_size == LTE_PDCP_Config__rlc_UM__pdcp_SN_Size_len7bits) {
|
||||
if (pdcp_pP->seq_num_size == 7) {
|
||||
/* 7 bits length SN */
|
||||
count = (((pdcp_pP->rx_hfn + pdcp_pP->rx_hfn_offset) << 7) | (pdcp_sn & 0x007F));
|
||||
count = (hfn << 7) | (sn & 0x007F);
|
||||
} else { // default
|
||||
/* 12 bits length SN */
|
||||
count = (((pdcp_pP->rx_hfn + pdcp_pP->rx_hfn_offset) << 12) | (pdcp_sn & 0x0FFF));
|
||||
count = (hfn << 12) | (sn & 0x0FFF);
|
||||
}
|
||||
}
|
||||
|
||||
// reset the hfn offset
|
||||
pdcp_pP->rx_hfn_offset =0;
|
||||
LOG_D(PDCP, "[OSA] RX COUNT = 0x%08x\n", count);
|
||||
|
||||
return count;
|
||||
@@ -182,7 +174,8 @@ pdcp_validate_security(
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t pdcp_header_len,
|
||||
const uint16_t current_sn,
|
||||
const uint32_t hfn,
|
||||
const int sn,
|
||||
uint8_t *const pdcp_pdu_buffer,
|
||||
const uint16_t sdu_buffer_size
|
||||
)
|
||||
@@ -201,7 +194,7 @@ pdcp_validate_security(
|
||||
|
||||
decrypt_params.direction = (pdcp_pP->is_ue == 1) ? SECU_DIRECTION_DOWNLINK : SECU_DIRECTION_UPLINK ;
|
||||
decrypt_params.bearer = rb_id - 1;
|
||||
decrypt_params.count = pdcp_get_next_count_rx(pdcp_pP, srb_flagP, current_sn);
|
||||
decrypt_params.count = pdcp_get_next_count_rx(pdcp_pP, srb_flagP, hfn, sn);
|
||||
decrypt_params.message = &pdcp_pdu_buffer[pdcp_header_len];
|
||||
decrypt_params.blength = (sdu_buffer_size - pdcp_header_len) << 3;
|
||||
decrypt_params.key_length = 16;
|
||||
@@ -246,5 +239,3 @@ pdcp_validate_security(
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_SECURITY */
|
||||
|
||||
@@ -140,152 +140,6 @@ boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if incoming PDU has a sequence number in accordance with the RX window
|
||||
* @return 1 if SN is okay, 0 otherwise
|
||||
* XXX Reordering window should also be handled here
|
||||
*/
|
||||
boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_flag_t srb_flagP)
|
||||
{
|
||||
|
||||
uint16_t reordering_window = 0;
|
||||
|
||||
LOG_D(PDCP, "Incoming RX Sequence number is %04d (next %04d\n", seq_num, pdcp_entity->next_pdcp_rx_sn);
|
||||
|
||||
if (pdcp_is_seq_num_size_valid(pdcp_entity) == FALSE || pdcp_is_seq_num_valid(seq_num, pdcp_entity->seq_num_size) == FALSE) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark received sequence numbers to keep track of missing ones
|
||||
* (and to build PDCP Control PDU for PDCP status report)
|
||||
*/
|
||||
if (pdcp_mark_current_pdu_as_received(seq_num, pdcp_entity) == TRUE) {
|
||||
LOG_D(PDCP, "Received sequence number successfuly marked\n");
|
||||
} else {
|
||||
LOG_W(PDCP, "Cannot mark received sequence number on the bitmap!\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* RX Procedures for SRB and DRBs as described in sec 5.1.2 of 36.323
|
||||
*/
|
||||
|
||||
if (srb_flagP) { // SRB
|
||||
|
||||
if (seq_num < pdcp_entity->next_pdcp_rx_sn) {
|
||||
// decipher and verify the integrity of the PDU (if applicable) using COUNT based on RX_HFN + 1 and the received PDCP SN
|
||||
pdcp_entity->rx_hfn++;
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
} else {
|
||||
// decipher and verify the integrity of the PDU (if applicable) using COUNT based using COUNT based on RX_HFN and the received PDCP SN
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
}
|
||||
|
||||
// Assume that integrity verification is applicable and the integrity verification is passed successfully;
|
||||
// or assume that integrity verification is not applicable:
|
||||
|
||||
// same the old next_pdcp_rx_sn to revert otherwise
|
||||
pdcp_entity->next_pdcp_rx_sn_before_integrity = pdcp_entity->next_pdcp_rx_sn;
|
||||
|
||||
if (seq_num != pdcp_entity->next_pdcp_rx_sn) {
|
||||
LOG_D(PDCP,"Re-adjusting the sequence number to %d from %d\n", seq_num,pdcp_entity->next_pdcp_rx_sn);
|
||||
}
|
||||
|
||||
//set Next_PDCP_RX_SN to the received PDCP SN +1 ;
|
||||
pdcp_entity->next_pdcp_rx_sn = seq_num;
|
||||
pdcp_advance_rx_window(pdcp_entity); // + 1, and check if it is larger than Maximum_PDCP_SN:
|
||||
|
||||
} else { // DRB
|
||||
|
||||
if (pdcp_entity->seq_num_size == PDCP_SN_7BIT) {
|
||||
reordering_window = REORDERING_WINDOW_SN_7BIT;
|
||||
} else {
|
||||
reordering_window = REORDERING_WINDOW_SN_12BIT;
|
||||
}
|
||||
|
||||
switch (pdcp_entity->rlc_mode) {
|
||||
case RLC_MODE_AM:
|
||||
if ((seq_num - pdcp_entity->last_submitted_pdcp_rx_sn > reordering_window) ||
|
||||
((0 <= pdcp_entity->last_submitted_pdcp_rx_sn - seq_num) &&
|
||||
(pdcp_entity->last_submitted_pdcp_rx_sn - seq_num < reordering_window) )) {
|
||||
|
||||
if (seq_num > pdcp_entity->next_pdcp_rx_sn) {
|
||||
/*
|
||||
* decipher the PDCP PDU as specified in the subclause 5.6, using COUNT based on RX_HFN - 1 and the received PDCP SN;
|
||||
*/
|
||||
pdcp_entity->rx_hfn_offset = -1;
|
||||
} else {
|
||||
/*
|
||||
* decipher the PDCP PDU as specified in the subclause 5.6, using COUNT based on RX_HFN and the received PDCP SN;
|
||||
*/
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
}
|
||||
|
||||
// discard this PDCP SDU;
|
||||
LOG_W(PDCP, "Out of the reordering window (Incoming SN:%d, Expected SN:%d): discard this PDCP SDU\n",
|
||||
seq_num, pdcp_entity->next_pdcp_rx_sn);
|
||||
return FALSE;
|
||||
} else if (pdcp_entity->next_pdcp_rx_sn - seq_num > reordering_window) {
|
||||
pdcp_entity->rx_hfn++;
|
||||
// use COUNT based on RX_HFN and the received PDCP SN for deciphering the PDCP PDU;
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
pdcp_entity->next_pdcp_rx_sn++;
|
||||
} else if (seq_num - pdcp_entity->next_pdcp_rx_sn >= reordering_window ) {
|
||||
// use COUNT based on RX_HFN – 1 and the received PDCP SN for deciphering the PDCP PDU;
|
||||
pdcp_entity->rx_hfn_offset = -1;
|
||||
} else if (seq_num >= pdcp_entity->next_pdcp_rx_sn ) {
|
||||
// use COUNT based on RX_HFN and the received PDCP SN for deciphering the PDCP PDU;
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
//set Next_PDCP_RX_SN to the received PDCP SN +1 ;
|
||||
pdcp_entity->next_pdcp_rx_sn = seq_num;
|
||||
pdcp_advance_rx_window(pdcp_entity); // + 1, anc check if it is larger than Maximum_PDCP_SN:
|
||||
LOG_D(PDCP,"Re-adjusting the sequence number to %d\n", seq_num);
|
||||
} else if (seq_num < pdcp_entity->next_pdcp_rx_sn) {
|
||||
// use COUNT based on RX_HFN and the received PDCP SN for deciphering the PDCP PDU;
|
||||
pdcp_entity->rx_hfn_offset = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RLC_MODE_UM :
|
||||
if (seq_num < pdcp_entity->next_pdcp_rx_sn) {
|
||||
pdcp_entity->rx_hfn++;
|
||||
}
|
||||
|
||||
// decipher the PDCP Data PDU using COUNT based on RX_HFN and the received PDCP SN as specified in the subclause 5.6;
|
||||
//set Next_PDCP_RX_SN to the received PDCP SN +1 ;
|
||||
pdcp_entity->next_pdcp_rx_sn = seq_num;
|
||||
pdcp_advance_rx_window(pdcp_entity); // + 1, and check if it is larger than Maximum_PDCP_SN:
|
||||
|
||||
break;
|
||||
|
||||
case RLC_MODE_TM :
|
||||
default:
|
||||
LOG_W(PDCP,"RLC mode %d not supported\n",pdcp_entity->rlc_mode);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (seq_num == pdcp_entity->next_pdcp_rx_sn) {
|
||||
LOG_I(PDCP, "Next expected SN (%d) arrived, advancing RX window\n", seq_num);
|
||||
|
||||
return pdcp_advance_rx_window(pdcp_entity);
|
||||
} else {
|
||||
LOG_E(PDCP, "Incoming SN is not the one we expected to receive! (Incoming:%d, Expected:%d)\n", \
|
||||
seq_num, pdcp_entity->next_pdcp_rx_sn);
|
||||
|
||||
|
||||
// Update first missing PDU (used in PDCP Control PDU for PDCP status report, see 6.2.6)
|
||||
if (pdcp_entity->first_missing_pdu != -1)
|
||||
pdcp_entity->first_missing_pdu = pdcp_entity->next_pdcp_rx_sn;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
boolean_t pdcp_mark_current_pdu_as_received(uint16_t seq_num, pdcp_t* pdcp_entity)
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -59,11 +59,6 @@ uint16_t pdcp_get_next_tx_seq_number(pdcp_t* pdcp_entity);
|
||||
* Advances the RX window state of given PDCP entity upon successfull receipt of a SDU
|
||||
*/
|
||||
boolean_t pdcp_advance_rx_window(pdcp_t* pdcp_entity);
|
||||
/**
|
||||
* Checks if incoming PDU has a sequence number in accordance with the RX window
|
||||
* @return TRUE if it is valid, FALSE otherwise
|
||||
*/
|
||||
boolean_t pdcp_is_rx_seq_number_valid(uint16_t seq_num, pdcp_t* pdcp_entity,srb_flag_t srb_flagP);
|
||||
/**
|
||||
* Updates missing PDU bitmap with incoming sequence number
|
||||
* @return TRUE if successful, FALSE otherwise
|
||||
|
||||
@@ -384,7 +384,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
//DevCheck(sdu_sizeP > 0, sdu_sizeP, 0, 0);
|
||||
if(sdu_sizeP <= 0) {
|
||||
LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__ ,__LINE__);
|
||||
LOG_E(RLC, "sdu_sizeP %d, file %s, line %d\n", sdu_sizeP, __FILE__,__LINE__);
|
||||
return RLC_OP_STATUS_BAD_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -573,8 +573,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
}
|
||||
|
||||
#else
|
||||
}
|
||||
else { /* MBMS_flag != 0 */
|
||||
} else { /* MBMS_flag != 0 */
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
LOG_E(RLC, "MBMS_flag != 0 while Rel10/Rel14 is not defined...\n");
|
||||
//handle_event(ERROR,"FILE %s FONCTION rlc_data_req() LINE %s : parameter module_id out of bounds :%d\n", __FILE__, __LINE__, module_idP);
|
||||
@@ -659,7 +658,7 @@ void rlc_data_conf (const protocol_ctxt_t *const ctxt_pP,
|
||||
//-----------------------------------------------------------------------------
|
||||
if (srb_flagP) {
|
||||
if (rlc_rrc_data_conf != NULL) {
|
||||
rlc_rrc_data_conf (ctxt_pP, rb_idP , muiP, statusP);
|
||||
rlc_rrc_data_conf (ctxt_pP, rb_idP, muiP, statusP);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -683,8 +682,6 @@ rlc_module_init (void) {
|
||||
}
|
||||
|
||||
for (module_id1=0; module_id1 < MAX_MOBILES_PER_ENB; module_id1++) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
|
||||
rlc_mbms_lcid2service_session_id_ue[module_id1][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_ue[module_id1][k].session_id = 0;
|
||||
@@ -693,23 +690,15 @@ rlc_module_init (void) {
|
||||
for (k=0; k < NB_RB_MBMS_MAX; k++) {
|
||||
rlc_mbms_rbid2lcid_ue[module_id1][k] = RLC_LC_UNALLOCATED;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
for (module_id1=0; module_id1 < NUMBER_OF_eNB_MAX; module_id1++) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
|
||||
for (k=0; k < RLC_MAX_MBMS_LC; k++) {
|
||||
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[module_id1][k].session_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].service_id = 0;
|
||||
rlc_mbms_lcid2service_session_id_eNB[0][k].session_id = 0;
|
||||
}
|
||||
|
||||
for (k=0; k < NB_RB_MBMS_MAX; k++) {
|
||||
rlc_mbms_rbid2lcid_eNB[module_id1][k] = RLC_LC_UNALLOCATED;
|
||||
}
|
||||
|
||||
#endif
|
||||
rlc_mbms_rbid2lcid_eNB[0][k] = RLC_LC_UNALLOCATED;
|
||||
}
|
||||
|
||||
pool_buffer_init();
|
||||
|
||||
@@ -179,7 +179,7 @@ uint8_t get_adjacent_cell_mod_id(uint16_t phyCellId) {
|
||||
|
||||
|
||||
uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich_Resource, uint32_t phich_duration, uint32_t frame
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
, uint32_t schedulingInfoSIB1
|
||||
#endif
|
||||
) {
|
||||
@@ -654,7 +654,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
|
||||
}
|
||||
else
|
||||
{
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_UplinkSubframeBitmapBR_r13 = NULL;
|
||||
sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_UplinkSubframeBitmapBR_r13 = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -949,7 +949,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
sib2 = &RC.rrc[Mod_id]->carrier[CC_id].sib2;
|
||||
rrconfig = &configuration->radioresourceconfig[CC_id];
|
||||
}
|
||||
|
||||
|
||||
LTE_SystemInformationBlockType3_t **sib3 = &RC.rrc[Mod_id]->carrier[CC_id].sib3;
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(9, 0, 0))
|
||||
LTE_SystemInformationBlockType13_r9_t **sib13 = &RC.rrc[Mod_id]->carrier[CC_id].sib13;
|
||||
@@ -1011,11 +1011,11 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
memset(sib18_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
|
||||
memset(sib19_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
|
||||
memset(sib21_part,0,sizeof(struct LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member));
|
||||
|
||||
|
||||
sib18_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib18_v1250;
|
||||
sib19_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib19_v1250;
|
||||
sib21_part->present = LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib21_v1430;
|
||||
|
||||
|
||||
*sib18 = &sib18_part->choice.sib18_v1250;
|
||||
*sib19 = &sib19_part->choice.sib19_v1250;
|
||||
*sib21 = &sib21_part->choice.sib21_v1430;
|
||||
@@ -1052,13 +1052,13 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
if (eMTC_configured>0) {
|
||||
(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1 = calloc(1, sizeof(struct LTE_RACH_ConfigCommon__ext1));
|
||||
memset((*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1, 0, sizeof(struct LTE_RACH_ConfigCommon__ext1));
|
||||
|
||||
|
||||
if (rrconfig->preambleTransMax_CE_r13) {
|
||||
(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = calloc(1, sizeof(LTE_PreambleTransMax_t));
|
||||
*(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = *rrconfig->preambleTransMax_CE_r13; // to be re-initialized when we find the enum
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = NULL;
|
||||
|
||||
|
||||
|
||||
(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13 = calloc(1, sizeof(LTE_RACH_CE_LevelInfoList_r13_t));
|
||||
memset((*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13, 0, sizeof(LTE_RACH_CE_LevelInfoList_r13_t));
|
||||
@@ -1209,14 +1209,14 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
}
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (configuration->sib2_freq_hoppingParameters_r13_exists[CC_id]) {
|
||||
|
||||
(*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = CALLOC(1, sizeof(LTE_FreqHoppingParameters_r13_t));
|
||||
|
||||
|
||||
if (configuration->sib2_interval_ULHoppingConfigCommonModeA_r13[CC_id]) {
|
||||
(*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13
|
||||
= CALLOC(1, sizeof(struct LTE_FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13));
|
||||
@@ -1237,7 +1237,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
}
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13 = NULL;
|
||||
|
||||
|
||||
|
||||
if (configuration->sib2_interval_ULHoppingConfigCommonModeB_r13[CC_id]) {
|
||||
(*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13
|
||||
@@ -1255,7 +1255,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
= configuration->sib2_interval_ULHoppingConfigCommonModeB_r13_val[CC_id];
|
||||
}
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13 = NULL;
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13 = NULL;
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = NULL;
|
||||
// pdsch_ConfigCommon_v1310
|
||||
@@ -1342,7 +1342,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
*(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_HoppingOffset_r13 = *rrconfig->prach_HoppingOffset_r13;
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_HoppingOffset_r13 = NULL;
|
||||
|
||||
|
||||
LTE_PRACH_ParametersCE_r13_t *prach_parametersce_r13;
|
||||
|
||||
int num_prach_parameters_ce = configuration->prach_parameters_list_size[CC_id];
|
||||
@@ -1362,14 +1362,14 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
*prach_parametersce_r13->prach_StartingSubframe_r13 = *configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index];
|
||||
}
|
||||
else prach_parametersce_r13->prach_StartingSubframe_r13 = NULL;
|
||||
|
||||
|
||||
|
||||
if (configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]) {
|
||||
prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = CALLOC(1, sizeof(long));
|
||||
*prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = *configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index];
|
||||
}
|
||||
else prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = NULL;
|
||||
|
||||
|
||||
prach_parametersce_r13->numRepetitionPerPreambleAttempt_r13 = configuration->numRepetitionPerPreambleAttempt_r13[CC_id][prach_parameters_index];
|
||||
prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = configuration->mpdcch_NumRepetition_RA_r13[CC_id][prach_parameters_index];
|
||||
prach_parametersce_r13->prach_HoppingConfig_r13 = configuration->prach_HoppingConfig_r13[CC_id][prach_parameters_index];
|
||||
@@ -1393,7 +1393,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
}
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310 = NULL;
|
||||
|
||||
|
||||
|
||||
|
||||
(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310 = calloc(1, sizeof(LTE_PUCCH_ConfigCommon_v1310_t));
|
||||
@@ -1407,7 +1407,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
pucch_info_value = CALLOC(1, sizeof(long));
|
||||
if (configuration->pucch_info_value_size[CC_id]) *pucch_info_value = configuration->pucch_info_value[CC_id][pucch_index];
|
||||
else *pucch_info_value = 0;
|
||||
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, pucch_info_value);
|
||||
}
|
||||
|
||||
@@ -1422,7 +1422,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
*(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = *configuration->pucch_NumRepetitionCE_Msg4_Level1_r13[CC_id];
|
||||
}
|
||||
else (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = NULL;
|
||||
|
||||
|
||||
|
||||
if (configuration->pucch_NumRepetitionCE_Msg4_Level2_r13[CC_id]) {
|
||||
(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13 = CALLOC(1, sizeof(long));
|
||||
@@ -1481,7 +1481,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
rach_ce_levelinfo_r13->rar_HoppingConfig_r13 = LTE_RACH_CE_LevelInfo_r13__rar_HoppingConfig_r13_off;
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13->list, rach_ce_levelinfo_r13);
|
||||
|
||||
|
||||
// BCCH-Config
|
||||
(*sib2)->radioResourceConfigCommon.bcch_Config.modificationPeriodCoeff=LTE_BCCH_Config__modificationPeriodCoeff_n2;
|
||||
|
||||
@@ -1733,15 +1733,15 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.prb_Start_r12 = configuration->rxPool_ResourceConfig_prb_Start[CC_id];
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.prb_End_r12 = configuration->rxPool_ResourceConfig_prb_End[CC_id];
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.present = configuration->rxPool_ResourceConfig_offsetIndicator_present[CC_id];
|
||||
|
||||
|
||||
if (SL_CommResourcePool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.present == LTE_SL_OffsetIndicator_r12_PR_small_r12 ) {
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = configuration->rxPool_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
} else if (SL_CommResourcePool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.present == LTE_SL_OffsetIndicator_r12_PR_large_r12 ) {
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.offsetIndicator_r12.choice.large_r12 = configuration->rxPool_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
}
|
||||
|
||||
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.present = configuration->rxPool_ResourceConfig_subframeBitmap_present[CC_id];
|
||||
|
||||
|
||||
if (SL_CommResourcePool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.present == LTE_SubframeBitmapSL_r12_PR_bs4_r12) {
|
||||
//for BS4
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs4_r12.size = configuration->rxPool_ResourceConfig_subframeBitmap_choice_bs_size[CC_id];
|
||||
@@ -1778,7 +1778,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.buf = (uint8_t *)configuration->rxPool_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];;
|
||||
SL_CommResourcePool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.bits_unused = configuration->rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id];
|
||||
}
|
||||
|
||||
|
||||
//dataHoppingConfig_r12
|
||||
SL_CommResourcePool->dataHoppingConfig_r12.hoppingParameter_r12 = 0;
|
||||
SL_CommResourcePool->dataHoppingConfig_r12.numSubbands_r12 = LTE_SL_HoppingConfigComm_r12__numSubbands_r12_ns1;
|
||||
@@ -1839,15 +1839,15 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.prb_Start_r12 = configuration->discRxPool_ResourceConfig_prb_Start[CC_id];
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.prb_End_r12 = configuration->discRxPool_ResourceConfig_prb_End[CC_id];
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.offsetIndicator_r12.present = configuration->discRxPool_ResourceConfig_offsetIndicator_present[CC_id];
|
||||
|
||||
|
||||
if (SL_DiscResourcePool->tf_ResourceConfig_r12.offsetIndicator_r12.present == LTE_SL_OffsetIndicator_r12_PR_small_r12 ) {
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = configuration->discRxPool_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
} else if (SL_DiscResourcePool->tf_ResourceConfig_r12.offsetIndicator_r12.present == LTE_SL_OffsetIndicator_r12_PR_large_r12 ) {
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.offsetIndicator_r12.choice.large_r12 = configuration->discRxPool_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
}
|
||||
|
||||
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.subframeBitmap_r12.present = configuration->discRxPool_ResourceConfig_subframeBitmap_present[CC_id];
|
||||
|
||||
|
||||
if (SL_DiscResourcePool->tf_ResourceConfig_r12.subframeBitmap_r12.present == LTE_SubframeBitmapSL_r12_PR_bs4_r12) {
|
||||
//for BS4
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs4_r12.size = configuration->discRxPool_ResourceConfig_subframeBitmap_choice_bs_size[CC_id];
|
||||
@@ -1884,36 +1884,36 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.buf = (uint8_t *)configuration->discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];;
|
||||
SL_DiscResourcePool->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.bits_unused = configuration->discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id];
|
||||
}
|
||||
|
||||
|
||||
//add SL_DiscResourcePool to SL_DiscRxPoolList
|
||||
ASN_SEQUENCE_ADD(&SL_DiscRxPoolList->list,SL_DiscResourcePool);
|
||||
/*
|
||||
//for DiscRxPoolPS
|
||||
(*sib19)->ext1 = CALLOC (1, sizeof(*(*sib19)->ext1));
|
||||
(*sib19)->ext1->discConfigPS_13 = CALLOC (1, sizeof(*((*sib19)->ext1->discConfigPS_13)));
|
||||
|
||||
|
||||
SL_DiscRxPoolPSList = &(*sib19)->ext1->discConfigPS_13->discRxPoolPS_r13;
|
||||
memset(SL_DiscRxPoolPSList,0,sizeof(*SL_DiscRxPoolPSList));
|
||||
//fill SL_DiscResourcePool
|
||||
SL_DiscResourcePoolPS = CALLOC(1, sizeof(*SL_DiscResourcePoolPS));
|
||||
|
||||
|
||||
SL_DiscResourcePoolPS->cp_Len_r12 = configuration->discRxPoolPS_cp_Len[CC_id];
|
||||
SL_DiscResourcePoolPS->discPeriod_r12 = configuration->discRxPoolPS_discPeriod[CC_id];
|
||||
//sc_TF_ResourceConfig_r12
|
||||
SL_DiscResourcePoolPS->numRetx_r12 = configuration->discRxPoolPS_numRetx[CC_id];
|
||||
SL_DiscResourcePoolPS->numRepetition_r12 = configuration->discRxPoolPS_numRepetition[CC_id];
|
||||
|
||||
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_Num_r12 = configuration->discRxPoolPS_ResourceConfig_prb_Num[CC_id];
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_Start_r12 = configuration->discRxPoolPS_ResourceConfig_prb_Start[CC_id];
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.prb_End_r12 = configuration->discRxPoolPS_ResourceConfig_prb_End[CC_id];
|
||||
|
||||
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_present[CC_id];
|
||||
if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present == SL_OffsetIndicator_r12_PR_small_r12 ) {
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.choice.small_r12 = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
} else if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.present == SL_OffsetIndicator_r12_PR_large_r12 ){
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.offsetIndicator_r12.choice.large_r12 = configuration->discRxPoolPS_ResourceConfig_offsetIndicator_choice[CC_id] ;
|
||||
}
|
||||
|
||||
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_present[CC_id];
|
||||
if (SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.present == SubframeBitmapSL_r12_PR_bs4_r12){
|
||||
//for BS4
|
||||
@@ -1951,7 +1951,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.buf = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[CC_id];;
|
||||
SL_DiscResourcePoolPS->tf_ResourceConfig_r12.subframeBitmap_r12.choice.bs42_r12.bits_unused = configuration->discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[CC_id];
|
||||
}
|
||||
|
||||
|
||||
//add SL_DiscResourcePool to SL_DiscRxPoolList
|
||||
ASN_SEQUENCE_ADD(&SL_DiscRxPoolPSList->list,SL_DiscResourcePoolPS);
|
||||
*/
|
||||
@@ -2883,7 +2883,7 @@ uint8_t do_RRCConnectionSetup_BR(
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->present = LTE_CQI_ReportPeriodic_PR_release;
|
||||
physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic->choice.release = (NULL_t)0;
|
||||
|
||||
|
||||
|
||||
/// TODO to be reviewed
|
||||
if (rrc->srs_enable[CC_id]) {
|
||||
physicalConfigDedicated2->soundingRS_UL_ConfigDedicated->present = LTE_SoundingRS_UL_ConfigDedicated_PR_setup;
|
||||
@@ -3724,7 +3724,6 @@ do_RRCConnectionReestablishment(
|
||||
rrc->carrier[CC_id].dl_CarrierFreq,
|
||||
earfcn_dl,
|
||||
is_rel8_only == true ? "true": "false");
|
||||
#if defined(ENABLE_SECURITY)
|
||||
|
||||
if (ue_context_pP->ue_context.nh_ncc >= 0) {
|
||||
derive_keNB_star(ue_context_pP->ue_context.nh, pci, earfcn_dl, is_rel8_only, KeNB_star);
|
||||
@@ -3738,9 +3737,6 @@ do_RRCConnectionReestablishment(
|
||||
// copy KeNB_star to ue_context_pP->ue_context.kenb
|
||||
memcpy (ue_context_pP->ue_context.kenb, KeNB_star, 32);
|
||||
ue_context_pP->ue_context.kenb_ncc = 0;
|
||||
#else
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nextHopChainingCount = 0;
|
||||
#endif
|
||||
rrcConnectionReestablishment->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r8.nonCriticalExtension = NULL;
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
|
||||
|
||||
@@ -63,24 +63,12 @@
|
||||
#include "LTE_UE-Capability-NB-r13.h" //equivalent of UE-EUTRA-Capability.h
|
||||
//-------------------
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
/* TODO: be sure this include is correct.
|
||||
* It solves a problem of compilation of the RRH GW,
|
||||
* issue #186.
|
||||
*/
|
||||
#if !defined(ENABLE_ITTI)
|
||||
# include "as_message.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# include "commonDef.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if ENABLE_RAL
|
||||
# include "collection/hashtable/obj_hashtable.h"
|
||||
#include "collection/hashtable/obj_hashtable.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -104,12 +92,12 @@ typedef struct uid_linear_allocator_NB_IoT_s {
|
||||
|
||||
//left as they are --> used in LAYER2/epenair2_proc.c and UE side
|
||||
typedef enum UE_STATE_NB_IoT_e {
|
||||
RRC_INACTIVE_NB_IoT=0,
|
||||
RRC_IDLE_NB_IoT,
|
||||
RRC_SI_RECEIVED_NB_IoT,
|
||||
RRC_CONNECTED_NB_IoT,
|
||||
RRC_RECONFIGURED_NB_IoT,
|
||||
RRC_HO_EXECUTION_NB_IoT //maybe not needed?
|
||||
RRC_INACTIVE_NB_IoT=0,
|
||||
RRC_IDLE_NB_IoT,
|
||||
RRC_SI_RECEIVED_NB_IoT,
|
||||
RRC_CONNECTED_NB_IoT,
|
||||
RRC_RECONFIGURED_NB_IoT,
|
||||
RRC_HO_EXECUTION_NB_IoT //maybe not needed?
|
||||
} UE_STATE_NB_IoT_t;
|
||||
|
||||
|
||||
@@ -250,20 +238,20 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
*
|
||||
* SRB_configList --> is used for the actual list of SRBs that is managed/that should be send over the RRC message
|
||||
* SRB_configList2--> refers to all the SRBs configured for that specific transaction identifier
|
||||
* this because in a single transaction one or more SRBs could be established
|
||||
* and you want to keep memory on what happen for every transaction
|
||||
* this because in a single transaction one or more SRBs could be established
|
||||
* and you want to keep memory on what happen for every transaction
|
||||
* Transaction ID (xid): is used to associate the proper RRC....Complete message received by the UE to the corresponding
|
||||
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
|
||||
* this because it could happen that more messages are transmitted at the same time
|
||||
* message previously sent by the eNB (e.g. RRCConnectionSetup -- RRCConnectionSetupComplete)
|
||||
* this because it could happen that more messages are transmitted at the same time
|
||||
*/
|
||||
LTE_SRB_ToAddModList_NB_r13_t* SRB_configList;//for SRB1 and SRB1bis
|
||||
LTE_SRB_ToAddModList_NB_r13_t* SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
LTE_DRB_ToAddModList_NB_r13_t* DRB_configList; //for all the DRBs
|
||||
LTE_DRB_ToAddModList_NB_r13_t* DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
|
||||
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
|
||||
LTE_SRB_ToAddModList_NB_r13_t *SRB_configList;//for SRB1 and SRB1bis
|
||||
LTE_SRB_ToAddModList_NB_r13_t *SRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER];
|
||||
LTE_DRB_ToAddModList_NB_r13_t *DRB_configList; //for all the DRBs
|
||||
LTE_DRB_ToAddModList_NB_r13_t *DRB_configList2[RRC_TRANSACTION_IDENTIFIER_NUMBER]; //for the configured DRBs of a xid
|
||||
uint8_t DRB_active[2];//in LTE was 8 --> at most 2 for NB-IoT
|
||||
|
||||
struct LTE_PhysicalConfigDedicated_NB_r13* physicalConfigDedicated_NB_IoT;
|
||||
LTE_MAC_MainConfig_NB_r13_t* mac_MainConfig_NB_IoT;
|
||||
struct LTE_PhysicalConfigDedicated_NB_r13 *physicalConfigDedicated_NB_IoT;
|
||||
LTE_MAC_MainConfig_NB_r13_t *mac_MainConfig_NB_IoT;
|
||||
|
||||
//No SPS(semi-persistent scheduling) in NB-IoT
|
||||
//No Measurement report in NB-IoT
|
||||
@@ -273,10 +261,8 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1;
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1bis;
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* KeNB as derived from KASME received from EPC */
|
||||
uint8_t kenb[32];
|
||||
#endif
|
||||
|
||||
/* Used integrity/ciphering algorithms--> maintained the same for NB-IoT */
|
||||
e_LTE_CipheringAlgorithm_r12 ciphering_algorithm; //Specs. TS 36.331 V14.1.0 pag 432 Change position of chipering enumerative w.r.t previous version
|
||||
@@ -315,7 +301,7 @@ typedef struct eNB_RRC_UE_NB_IoT_s {
|
||||
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
|
||||
|
||||
//Which timers are referring to?
|
||||
//Which timers are referring to?
|
||||
uint32_t ul_failure_timer;
|
||||
uint32_t ue_release_timer;
|
||||
//threshold of the release timer--> set in RRCConnectionRelease
|
||||
@@ -352,13 +338,13 @@ typedef struct rrc_eNB_ue_context_NB_IoT_s {
|
||||
typedef struct {
|
||||
|
||||
// buffer that contains the encoded messages
|
||||
uint8_t *MIB_NB_IoT;
|
||||
uint8_t sizeof_MIB_NB_IoT;
|
||||
uint8_t *MIB_NB_IoT;
|
||||
uint8_t sizeof_MIB_NB_IoT;
|
||||
|
||||
uint8_t *SIB1_NB_IoT;
|
||||
uint8_t sizeof_SIB1_NB_IoT;
|
||||
uint8_t *SIB23_NB_IoT;
|
||||
uint8_t sizeof_SIB23_NB_IoT;
|
||||
uint8_t *SIB23_NB_IoT;
|
||||
uint8_t sizeof_SIB23_NB_IoT;
|
||||
|
||||
|
||||
//not actually implemented in OAI
|
||||
@@ -372,18 +358,18 @@ typedef struct {
|
||||
uint8_t sizeof_SIB16_NB_IoT;
|
||||
|
||||
//TS 36.331 V14.2.1
|
||||
// uint8_t *SIB15_NB;
|
||||
// uint8_t sizeof_SIB15_NB;
|
||||
// uint8_t *SIB20_NB;
|
||||
// uint8_t sizeof_SIB20_NB;
|
||||
// uint8_t *SIB22_NB;
|
||||
// uint8_t sizeof_SIB22_NB;
|
||||
// uint8_t *SIB15_NB;
|
||||
// uint8_t sizeof_SIB15_NB;
|
||||
// uint8_t *SIB20_NB;
|
||||
// uint8_t sizeof_SIB20_NB;
|
||||
// uint8_t *SIB22_NB;
|
||||
// uint8_t sizeof_SIB22_NB;
|
||||
|
||||
//implicit parameters needed
|
||||
int Ncp; //cyclic prefix for DL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int Ncp_UL; //cyclic prefix for UL
|
||||
int p_eNB; //number of tx antenna port
|
||||
int p_rx_eNB; //number of receiving antenna ports
|
||||
int p_rx_eNB; //number of receiving antenna ports
|
||||
uint32_t dl_CarrierFreq; //detected by the UE
|
||||
uint32_t ul_CarrierFreq; //detected by the UE
|
||||
uint16_t physCellId; //not stored in the MIB-NB but is getting through NPSS/NSSS
|
||||
@@ -393,12 +379,12 @@ typedef struct {
|
||||
LTE_BCCH_DL_SCH_Message_NB_t siblock1_NB_IoT; //SIB1-NB
|
||||
LTE_BCCH_DL_SCH_Message_NB_t systemInformation_NB_IoT; //SI
|
||||
|
||||
LTE_SystemInformationBlockType1_NB_t *sib1_NB_IoT;
|
||||
LTE_SystemInformationBlockType2_NB_r13_t *sib2_NB_IoT;
|
||||
LTE_SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
|
||||
LTE_SystemInformationBlockType1_NB_t *sib1_NB_IoT;
|
||||
LTE_SystemInformationBlockType2_NB_r13_t *sib2_NB_IoT;
|
||||
LTE_SystemInformationBlockType3_NB_r13_t *sib3_NB_IoT;
|
||||
//not implemented yet
|
||||
LTE_SystemInformationBlockType4_NB_r13_t *sib4_NB_IoT;
|
||||
LTE_SystemInformationBlockType5_NB_r13_t *sib5_NB_IoT;
|
||||
LTE_SystemInformationBlockType4_NB_r13_t *sib4_NB_IoT;
|
||||
LTE_SystemInformationBlockType5_NB_r13_t *sib5_NB_IoT;
|
||||
LTE_SystemInformationBlockType14_NB_r13_t *sib14_NB_IoT;
|
||||
LTE_SystemInformationBlockType16_NB_r13_t *sib16_NB_IoT;
|
||||
|
||||
@@ -414,9 +400,9 @@ typedef struct {
|
||||
SystemInformationBlockType20_NB_r14_t *sib20;
|
||||
SystemInformationBlockType22_NB_r14_t *sib22;
|
||||
|
||||
uint8_t SCPTM_flag;
|
||||
uint8_t sizeof_SC_MCHH_MESS[];
|
||||
SC_MCCH_Message_NB_t scptm;*/
|
||||
uint8_t SCPTM_flag;
|
||||
uint8_t sizeof_SC_MCHH_MESS[];
|
||||
SC_MCCH_Message_NB_t scptm;*/
|
||||
|
||||
|
||||
} rrc_eNB_carrier_data_NB_IoT_t;
|
||||
@@ -463,9 +449,9 @@ typedef struct eNB_RRC_INST_NB_IoT_s {
|
||||
|
||||
//not needed for the moment
|
||||
typedef struct OAI_UECapability_NB_IoT_s {
|
||||
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
|
||||
uint8_t sdu_size;
|
||||
////NB-IoT------
|
||||
uint8_t sdu[MAX_UE_CAPABILITY_SIZE_NB_IoT];
|
||||
uint8_t sdu_size;
|
||||
////NB-IoT------
|
||||
LTE_UE_Capability_NB_r13_t UE_Capability_NB_IoT; //replace the UE_EUTRA_Capability of LTE
|
||||
} OAI_UECapability_NB_IoT_t;
|
||||
|
||||
@@ -476,17 +462,15 @@ typedef struct OAI_UECapability_NB_IoT_s {
|
||||
typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
Rrc_State_NB_IoT_t RrcState;
|
||||
Rrc_Sub_State_NB_IoT_t RrcSubState;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
plmn_t plmnID;
|
||||
Byte_t rat;
|
||||
as_nas_info_t initialNasMsg;
|
||||
# endif
|
||||
OAI_UECapability_NB_IoT_t *UECap;
|
||||
uint8_t *UECapability;
|
||||
uint8_t UECapability_size;
|
||||
|
||||
UE_RRC_INFO_NB_IoT Info[NB_SIG_CNX_UE];
|
||||
|
||||
|
||||
SRB_INFO_NB_IoT Srb0[NB_SIG_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb1[NB_CNX_UE];
|
||||
SRB_INFO_TABLE_ENTRY_NB_IoT Srb2[NB_CNX_UE];
|
||||
@@ -513,7 +497,7 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
|
||||
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
|
||||
uint8_t MBMS_flag;
|
||||
uint8_t *MCCH_MESSAGE[NB_CNX_UE];
|
||||
uint8_t sizeof_MCCH_MESSAGE[NB_CNX_UE];
|
||||
@@ -521,11 +505,11 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
MBSFNAreaConfiguration_r9_t *mcch_message[NB_CNX_UE];
|
||||
SystemInformationBlockType12_r9_t *sib12[NB_CNX_UE];
|
||||
SystemInformationBlockType13_r9_t *sib13[NB_CNX_UE];
|
||||
#endif
|
||||
#ifdef CBA
|
||||
#endif
|
||||
#ifdef CBA
|
||||
uint8_t num_active_cba_groups;
|
||||
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
|
||||
#endif
|
||||
#endif
|
||||
uint8_t num_srb;
|
||||
struct SRB_ToAddMod *SRB1_config[NB_CNX_UE];
|
||||
struct SRB_ToAddMod *SRB2_config[NB_CNX_UE];
|
||||
@@ -551,14 +535,14 @@ typedef struct UE_RRC_INST_NB_IoT_s {
|
||||
float rsrq_db[7];
|
||||
float rsrp_db_filtered[7];
|
||||
float rsrq_db_filtered[7];
|
||||
#if ENABLE_RAL
|
||||
#if ENABLE_RAL
|
||||
obj_hash_table_t *ral_meas_thresholds;
|
||||
ral_transaction_id_t scan_transaction_id;
|
||||
#endif
|
||||
#if defined(ENABLE_SECURITY)
|
||||
#endif
|
||||
#if defined(ENABLE_SECURITY)
|
||||
// KeNB as computed from parameters within USIM card //
|
||||
uint8_t kenb[32];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Used integrity/ciphering algorithms //
|
||||
CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
|
||||
+83
-108
@@ -69,17 +69,14 @@
|
||||
#include "rrc_UE_ral.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#endif
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "plmn_data.h"
|
||||
#include "msc.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
|
||||
@@ -156,12 +153,11 @@ uint8_t rrc_ue_generate_SidelinkUEInformation( const protocol_ctxt_t *const ctxt
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
/* to avoid gcc warnings when compiling with certain options */
|
||||
#if defined(ENABLE_USE_MME) || ENABLE_RAL
|
||||
|
||||
static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP) {
|
||||
return UE_rrc_inst[ue_mod_idP].RrcState;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP) {
|
||||
return UE_rrc_inst[ue_mod_idP].RrcSubState;
|
||||
@@ -181,27 +177,25 @@ static int rrc_set_state (module_id_t ue_mod_idP, Rrc_State_t state) {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static int rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_t subState ) {
|
||||
#if (defined(ENABLE_ITTI) && (defined(ENABLE_USE_MME) || ENABLE_RAL))
|
||||
if (EPC_MODE_ENABLED) {
|
||||
switch (UE_rrc_inst[ue_mod_idP].RrcState) {
|
||||
case RRC_STATE_INACTIVE:
|
||||
AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
|
||||
switch (UE_rrc_inst[ue_mod_idP].RrcState) {
|
||||
case RRC_STATE_INACTIVE:
|
||||
AssertFatal ((RRC_SUB_STATE_INACTIVE_FIRST <= subState) && (subState <= RRC_SUB_STATE_INACTIVE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
case RRC_STATE_IDLE:
|
||||
AssertFatal ((RRC_SUB_STATE_IDLE_FIRST <= subState) && (subState <= RRC_SUB_STATE_IDLE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
|
||||
case RRC_STATE_IDLE:
|
||||
AssertFatal ((RRC_SUB_STATE_IDLE_FIRST <= subState) && (subState <= RRC_SUB_STATE_IDLE_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
|
||||
case RRC_STATE_CONNECTED:
|
||||
AssertFatal ((RRC_SUB_STATE_CONNECTED_FIRST <= subState) && (subState <= RRC_SUB_STATE_CONNECTED_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
case RRC_STATE_CONNECTED:
|
||||
AssertFatal ((RRC_SUB_STATE_CONNECTED_FIRST <= subState) && (subState <= RRC_SUB_STATE_CONNECTED_LAST),
|
||||
"Invalid sub state %d for state %d!\n", subState, UE_rrc_inst[ue_mod_idP].RrcState);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (UE_rrc_inst[ue_mod_idP].RrcSubState != subState) {
|
||||
UE_rrc_inst[ue_mod_idP].RrcSubState = subState;
|
||||
return (1);
|
||||
@@ -233,7 +227,7 @@ openair_rrc_on_ue(
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void init_SI_UE( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
static void init_SI_UE( protocol_ctxt_t const *ctxt_pP, const uint8_t eNB_index ) {
|
||||
UE_rrc_inst[ctxt_pP->module_id].sizeof_SIB1[eNB_index] = 0;
|
||||
UE_rrc_inst[ctxt_pP->module_id].sizeof_SI[eNB_index] = 0;
|
||||
UE_rrc_inst[ctxt_pP->module_id].SIB1[eNB_index] = (uint8_t *)malloc16_clear( 32 );
|
||||
@@ -428,7 +422,6 @@ void init_SL_preconfig(UE_RRC_INST *UE, const uint8_t eNB_index ) {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void openair_rrc_ue_init_security( const protocol_ctxt_t *const ctxt_pP ) {
|
||||
#if defined(ENABLE_SECURITY)
|
||||
// uint8_t *kRRCenc;
|
||||
// uint8_t *kRRCint;
|
||||
char ascii_buffer[65];
|
||||
@@ -442,7 +435,6 @@ void openair_rrc_ue_init_security( const protocol_ctxt_t *const ctxt_pP ) {
|
||||
LOG_T(RRC, PROTOCOL_RRC_CTXT_FMT"[OSA] kenb = %s\n",
|
||||
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
|
||||
ascii_buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -534,9 +526,9 @@ void rrc_ue_generate_RRCConnectionRequest( const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
mui_t rrc_mui=0;
|
||||
|
||||
#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
|
||||
|
||||
/* NAS Attach request with IMSI */
|
||||
static const char const nas_attach_req_imsi[] = {
|
||||
static const char nas_attach_req_imsi[] = {
|
||||
0x07, 0x41,
|
||||
/* EPS Mobile identity = IMSI */
|
||||
0x71, 0x08, 0x29, 0x80, 0x43, 0x21, 0x43, 0x65, 0x87,
|
||||
@@ -548,7 +540,7 @@ static const char const nas_attach_req_imsi[] = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
#endif /* !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) */
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
@@ -596,13 +588,15 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t *c
|
||||
uint8_t size;
|
||||
const char *nas_msg;
|
||||
int nas_msg_length;
|
||||
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
|
||||
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
|
||||
#else
|
||||
nas_msg = nas_attach_req_imsi;
|
||||
nas_msg_length = sizeof(nas_attach_req_imsi);
|
||||
#endif
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
nas_msg = (char *) UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data;
|
||||
nas_msg_length = UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.length;
|
||||
} else {
|
||||
nas_msg = nas_attach_req_imsi;
|
||||
nas_msg_length = sizeof(nas_attach_req_imsi);
|
||||
}
|
||||
|
||||
size = do_RRCConnectionSetupComplete(ctxt_pP->module_id, buffer, Transaction_id, nas_msg_length, nas_msg);
|
||||
LOG_I(RRC,"[UE %d][RAPROC] Frame %d : Logical Channel UL-DCCH (SRB1), Generating RRCConnectionSetupComplete (bytes%d, eNB %d)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame, size, eNB_index);
|
||||
@@ -800,15 +794,14 @@ rrc_ue_establish_drb(
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
// add descriptor from RRC PDU
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
|
||||
/* avoid gcc warnings */
|
||||
(void)oip_ifup;
|
||||
(void)ip_addr_offset3;
|
||||
(void)ip_addr_offset4;
|
||||
#endif
|
||||
LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
|
||||
ue_mod_idP, frameP, DRB_config->drb_Identity, (int)*DRB_config->logicalChannelIdentity);
|
||||
|
||||
/*
|
||||
rrc_pdcp_config_req (ue_mod_idP+NB_eNB_INST, frameP, 0, CONFIG_ACTION_ADD,
|
||||
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity, UNDEF_SECURITY_MODE);
|
||||
@@ -817,33 +810,34 @@ rrc_ue_establish_drb(
|
||||
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
|
||||
RADIO_ACCESS_BEARER,Rlc_info_um);
|
||||
*/
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
if(PDCP_USE_NETLINK) {
|
||||
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id
|
||||
ip_addr_offset3+ue_mod_idP+1, // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1); // fourth_octet
|
||||
ip_addr_offset3 = 0;
|
||||
ip_addr_offset4 = 1;
|
||||
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
|
||||
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id
|
||||
ip_addr_offset3+ue_mod_idP+1, // third_octet
|
||||
ip_addr_offset4+ue_mod_idP+1); // fourth_octet
|
||||
|
||||
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
|
||||
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
|
||||
0,//dscp
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
|
||||
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
|
||||
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
|
||||
}
|
||||
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1309,12 +1303,10 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
if (radioResourceConfigDedicated->srb_ToAddModList) {
|
||||
uint8_t *kRRCenc = NULL;
|
||||
uint8_t *kRRCint = NULL;
|
||||
#if defined(ENABLE_SECURITY)
|
||||
derive_key_rrc_enc(UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm,
|
||||
UE_rrc_inst[ctxt_pP->module_id].kenb, &kRRCenc);
|
||||
derive_key_rrc_int(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm,
|
||||
UE_rrc_inst[ctxt_pP->module_id].kenb, &kRRCint);
|
||||
#endif
|
||||
// Refresh SRBs
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
radioResourceConfigDedicated->srb_ToAddModList,
|
||||
@@ -1487,10 +1479,8 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
}
|
||||
|
||||
uint8_t *kUPenc = NULL;
|
||||
#if defined(ENABLE_SECURITY)
|
||||
derive_key_up_enc(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm,
|
||||
UE_rrc_inst[ctxt_pP->module_id].kenb, &kUPenc);
|
||||
#endif
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_UE,
|
||||
MSC_PDCP_UE,
|
||||
@@ -1665,7 +1655,6 @@ rrc_ue_process_securityModeCommand(
|
||||
ul_dcch_msg.message.choice.c1.present = LTE_UL_DCCH_MessageType__c1_PR_securityModeFailure;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
uint8_t *kRRCenc = NULL;
|
||||
uint8_t *kUPenc = NULL;
|
||||
uint8_t *kRRCint = NULL;
|
||||
@@ -1715,8 +1704,6 @@ rrc_ue_process_securityModeCommand(
|
||||
LOG_I(RRC, "Could not get PDCP instance where key=0x%ld\n", key);
|
||||
}
|
||||
|
||||
#endif //#if defined(ENABLE_SECURITY)
|
||||
|
||||
if (securityModeCommand->criticalExtensions.present == LTE_SecurityModeCommand__criticalExtensions_PR_c1) {
|
||||
if (securityModeCommand->criticalExtensions.choice.c1.present != LTE_SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8)
|
||||
LOG_W(RRC,"securityModeCommand->criticalExtensions.choice.c1.present (%d) != SecurityModeCommand__criticalExtensions__c1_PR_securityModeCommand_r8\n",
|
||||
@@ -1906,7 +1893,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
);
|
||||
}
|
||||
*/
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Check if there is dedicated NAS information to forward to NAS */
|
||||
if (rrcConnectionReconfiguration_r8->dedicatedInfoNASList != NULL) {
|
||||
@@ -1970,7 +1956,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
|
||||
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_REESTABLISHMENT_IND to mRAL\n");
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
} // c1 present
|
||||
} // critical extensions present
|
||||
@@ -2134,9 +2119,7 @@ rrc_ue_decode_dcch(
|
||||
// asn_dec_rval_t dec_rval;
|
||||
// int i;
|
||||
uint8_t target_eNB_index=0xFF;
|
||||
#if defined(ENABLE_ITTI)
|
||||
MessageDef *msg_p;
|
||||
#endif
|
||||
|
||||
if (Srb_id != 1) {
|
||||
LOG_E(RRC,"[UE %d] Frame %d: Received message on DL-DCCH (SRB%d), should not have ...\n",
|
||||
@@ -2166,7 +2149,6 @@ rrc_ue_decode_dcch(
|
||||
break;
|
||||
|
||||
case LTE_DL_DCCH_MessageType__c1_PR_dlInformationTransfer: {
|
||||
#if defined(ENABLE_ITTI)
|
||||
LTE_DLInformationTransfer_t *dlInformationTransfer = &dl_dcch_msg->message.choice.c1.choice.dlInformationTransfer;
|
||||
|
||||
if ((dlInformationTransfer->criticalExtensions.present == LTE_DLInformationTransfer__criticalExtensions_PR_c1)
|
||||
@@ -2189,7 +2171,6 @@ rrc_ue_decode_dcch(
|
||||
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2244,7 +2225,6 @@ rrc_ue_decode_dcch(
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[target_eNB_index].State = RRC_RECONFIGURED;
|
||||
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED during HO (eNB %d)\n",
|
||||
ctxt_pP->module_id, target_eNB_index);
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if ENABLE_RAL
|
||||
{
|
||||
MessageDef *message_ral_p = NULL;
|
||||
@@ -2289,7 +2269,6 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_HO_IND to mRAL\n");
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
rrc_ue_generate_RRCConnectionReconfigurationComplete(
|
||||
@@ -2300,7 +2279,6 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "[UE %d] State = RRC_RECONFIGURED (eNB %d)\n",
|
||||
ctxt_pP->module_id,
|
||||
eNB_indexP);
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if ENABLE_RAL
|
||||
{
|
||||
MessageDef *message_ral_p = NULL;
|
||||
@@ -2345,7 +2323,6 @@ rrc_ue_decode_dcch(
|
||||
LOG_I(RRC, "Sending RRC_RAL_CONNECTION_RECONFIGURATION_IND to mRAL\n");
|
||||
itti_send_msg_to_task (TASK_RAL_UE, ctxt_pP->instance, message_ral_p);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2369,7 +2346,6 @@ rrc_ue_decode_dcch(
|
||||
break;
|
||||
|
||||
case LTE_DL_DCCH_MessageType__c1_PR_rrcConnectionRelease:
|
||||
#if defined(ENABLE_ITTI)
|
||||
msg_p = itti_alloc_new_message(TASK_RRC_UE, NAS_CONN_RELEASE_IND);
|
||||
|
||||
if ((dl_dcch_msg->message.choice.c1.choice.rrcConnectionRelease.criticalExtensions.present
|
||||
@@ -2385,7 +2361,6 @@ rrc_ue_decode_dcch(
|
||||
msg_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_CONNECTION_RELEASE_IND);
|
||||
RRC_RAL_CONNECTION_RELEASE_IND(msg_p).ue_id = ctxt_pP->module_id;
|
||||
itti_send_msg_to_task(TASK_RAL_UE, ctxt_pP->instance, msg_p);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -2682,13 +2657,16 @@ int decode_BCCH_DLSCH_Message(
|
||||
}
|
||||
}
|
||||
|
||||
if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
|
||||
#endif
|
||||
) {
|
||||
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
|
||||
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
|
||||
// if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
|
||||
//#if defined(ENABLE_USE_MME)
|
||||
// && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
|
||||
//#endif
|
||||
// ) {
|
||||
if (rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) {
|
||||
if ( (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) || (!EPC_MODE_ENABLED)) {
|
||||
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
|
||||
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_BCCH, VCD_FUNCTION_OUT );
|
||||
@@ -2873,8 +2851,9 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
LOG_I(RRC,"Setting SIStatus bit 0 to 1\n");
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus = 1;
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag = sib1->systemInfoValueTag;
|
||||
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
{
|
||||
|
||||
//#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
int cell_valid = 0;
|
||||
|
||||
if (sib1->cellAccessRelatedInfo.cellBarred == LTE_SystemInformationBlockType1__cellAccessRelatedInfo__cellBarred_notBarred) {
|
||||
@@ -2922,7 +2901,7 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
cell_valid = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} /* for plmn = 0;... */
|
||||
}
|
||||
|
||||
if (cell_valid == 0) {
|
||||
@@ -2932,8 +2911,8 @@ int decode_SIB1( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index,
|
||||
itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p);
|
||||
LOG_E(RRC, "Synched with a cell, but PLMN doesn't match our SIM, the message PHY_FIND_NEXT_CELL_REQ is sent but lost in current UE implementation! \n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}/* EPC_MODE_ENABLED */
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_OUT );
|
||||
return 0;
|
||||
}
|
||||
@@ -3500,8 +3479,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
#endif
|
||||
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
|
||||
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" );
|
||||
return -1;
|
||||
}
|
||||
@@ -3560,10 +3538,9 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].MBMS_flag < 3) // see -Q option
|
||||
#endif
|
||||
#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
|
||||
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
|
||||
|
||||
#endif
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rrc_ue_generate_RRCConnectionRequest( ctxt_pP, eNB_index );
|
||||
}
|
||||
|
||||
if (UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].State == RRC_IDLE) {
|
||||
LOG_I( RRC, "[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n", ctxt_pP->module_id );
|
||||
@@ -3827,7 +3804,7 @@ int decode_SI( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index ) {
|
||||
sib1->schedulingInfoList.list.count);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI , VCD_FUNCTION_OUT);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_OUT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4095,7 +4072,7 @@ uint8_t check_trigger_meas_event(
|
||||
uint8_t eNB_offset;
|
||||
// uint8_t currentCellIndex = frame_parms->Nid_cell;
|
||||
uint8_t tmp_offset;
|
||||
LOG_I(RRC,"[UE %d] ofn(%ld) ocn(%ld) hys(%ld) ofs(%ld) ocs(%ld) a3_offset(%ld) ttt(%ld) rssi %3.1f\n",
|
||||
LOG_D(RRC,"[UE %d] ofn(%ld) ocn(%ld) hys(%ld) ofs(%ld) ocs(%ld) a3_offset(%ld) ttt(%ld) rssi %3.1f\n",
|
||||
ue_mod_idP,
|
||||
ofn,ocn,hys,ofs,ocs,a3_offset,ttt,
|
||||
10*log10(get_RSSI(ue_mod_idP,0))-get_rx_total_gain_dB(ue_mod_idP,0));
|
||||
@@ -4291,7 +4268,6 @@ void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_index, f
|
||||
|
||||
#endif // rel10
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
//-----------------------------------------------------------------------------
|
||||
void *rrc_ue_task( void *args_p ) {
|
||||
MessageDef *msg_p;
|
||||
@@ -4315,6 +4291,7 @@ void *rrc_ue_task( void *args_p ) {
|
||||
break;
|
||||
|
||||
case MESSAGE_TEST:
|
||||
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
|
||||
break;
|
||||
|
||||
/* MAC messages */
|
||||
@@ -4419,7 +4396,6 @@ void *rrc_ue_task( void *args_p ) {
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_IND (msg_p).sdu_p);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
break;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
case NAS_KENB_REFRESH_REQ:
|
||||
memcpy((void *)UE_rrc_inst[ue_mod_id].kenb, (void *)NAS_KENB_REFRESH_REQ(msg_p).kenb, sizeof(UE_rrc_inst[ue_mod_id].kenb));
|
||||
@@ -4570,7 +4546,6 @@ void *rrc_ue_task( void *args_p ) {
|
||||
break;
|
||||
}
|
||||
|
||||
# endif
|
||||
# if ENABLE_RAL
|
||||
|
||||
case RRC_RAL_SCAN_REQ:
|
||||
@@ -4722,7 +4697,7 @@ void *rrc_ue_task( void *args_p ) {
|
||||
msg_p = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5028,7 +5003,7 @@ rrc_control_socket_init() {
|
||||
// error("ERROR: Failed on opening socket");
|
||||
optval = 1;
|
||||
setsockopt(ctrl_sock_fd, SOL_SOCKET, SO_REUSEADDR,
|
||||
(const void *)&optval , sizeof(int));
|
||||
(const void *)&optval, sizeof(int));
|
||||
//build the server's address
|
||||
bzero((char *) &rrc_ctrl_socket_addr, sizeof(rrc_ctrl_socket_addr));
|
||||
rrc_ctrl_socket_addr.sin_family = AF_INET;
|
||||
|
||||
@@ -285,21 +285,14 @@ void *send_UE_status_notification(void *);
|
||||
#include "rrc_rrm_interface.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
/* TODO: be sure this include is correct.
|
||||
* It solves a problem of compilation of the RRH GW,
|
||||
* issue #186.
|
||||
*/
|
||||
#if !defined(ENABLE_ITTI)
|
||||
#include "as_message.h"
|
||||
#endif
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#include "commonDef.h"
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "commonDef.h"
|
||||
#endif
|
||||
|
||||
//--------
|
||||
typedef unsigned int uid_t;
|
||||
@@ -432,7 +425,7 @@ typedef struct UE_S_TMSI_s {
|
||||
m_tmsi_t m_tmsi;
|
||||
} __attribute__ ((__packed__)) UE_S_TMSI;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
typedef enum e_rab_satus_e {
|
||||
E_RAB_STATUS_NEW,
|
||||
E_RAB_STATUS_DONE, // from the eNB perspective
|
||||
@@ -449,7 +442,7 @@ typedef struct e_rab_param_s {
|
||||
s1ap_Cause_t cause;
|
||||
uint8_t cause_value;
|
||||
} __attribute__ ((__packed__)) e_rab_param_t;
|
||||
#endif
|
||||
|
||||
|
||||
/* Intermediate structure for Handover management. Associated per-UE in eNB_RRC_INST */
|
||||
typedef struct HANDOVER_INFO_s {
|
||||
@@ -555,13 +548,11 @@ typedef struct eNB_RRC_UE_s {
|
||||
int UE_Capability_size;
|
||||
ImsiMobileIdentity_t imsi;
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* KeNB as derived from KASME received from EPC */
|
||||
uint8_t kenb[32];
|
||||
int8_t kenb_ncc;
|
||||
uint8_t nh[32];
|
||||
int8_t nh_ncc;
|
||||
#endif
|
||||
/* Used integrity/ciphering algorithms */
|
||||
LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
@@ -570,7 +561,7 @@ typedef struct eNB_RRC_UE_s {
|
||||
rnti_t rnti;
|
||||
uint64_t random_ue_identity;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/* Information from UE RRC ConnectionRequest */
|
||||
UE_S_TMSI Initialue_identity_s_TMSI;
|
||||
LTE_EstablishmentCause_t establishment_cause;
|
||||
@@ -614,7 +605,6 @@ typedef struct eNB_RRC_UE_s {
|
||||
uint32_t enb_gtp_teid[S1AP_MAX_E_RAB];
|
||||
transport_layer_addr_t enb_gtp_addrs[S1AP_MAX_E_RAB];
|
||||
rb_id_t enb_gtp_ebi[S1AP_MAX_E_RAB];
|
||||
#endif
|
||||
uint32_t ul_failure_timer;
|
||||
uint32_t ue_release_timer;
|
||||
uint32_t ue_release_timer_thres;
|
||||
@@ -731,9 +721,7 @@ typedef struct eNB_RRC_INST_s {
|
||||
#endif
|
||||
|
||||
//RRC configuration
|
||||
#if defined(ENABLE_ITTI)
|
||||
RrcConfigurationReq configuration;
|
||||
#endif
|
||||
|
||||
/// NR cell id
|
||||
uint64_t nr_cellid;
|
||||
@@ -763,11 +751,9 @@ typedef struct OAI_UECapability_s {
|
||||
typedef struct UE_RRC_INST_s {
|
||||
Rrc_State_t RrcState;
|
||||
Rrc_Sub_State_t RrcSubState;
|
||||
# if defined(ENABLE_USE_MME)
|
||||
plmn_t plmnID;
|
||||
Byte_t rat;
|
||||
as_nas_info_t initialNasMsg;
|
||||
# endif
|
||||
OAI_UECapability_t *UECap;
|
||||
uint8_t *UECapability;
|
||||
uint8_t UECapability_size;
|
||||
@@ -852,12 +838,10 @@ typedef struct UE_RRC_INST_s {
|
||||
float rsrq_db[7];
|
||||
float rsrp_db_filtered[7];
|
||||
float rsrq_db_filtered[7];
|
||||
#if defined(ENABLE_SECURITY)
|
||||
/* KeNB as computed from parameters within USIM card */
|
||||
uint8_t kenb[32];
|
||||
uint8_t nh[32];
|
||||
int8_t nh_ncc;
|
||||
#endif
|
||||
|
||||
/* Used integrity/ciphering algorithms */
|
||||
LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
|
||||
+175
-378
File diff suppressed because it is too large
Load Diff
@@ -27,53 +27,41 @@
|
||||
* \email: lionel.gauthier@eurecom.fr
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# include "rrc_defs.h"
|
||||
# include "rrc_extern.h"
|
||||
# include "RRC/LTE/MESSAGES/asn1_msg.h"
|
||||
# include "rrc_eNB_GTPV1U.h"
|
||||
# include "rrc_eNB_UE_context.h"
|
||||
# include "msc.h"
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
# include "asn1_conversions.h"
|
||||
# include "intertask_interface.h"
|
||||
# endif
|
||||
|
||||
# include "common/ran_context.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
)
|
||||
{
|
||||
) {
|
||||
rnti_t rnti;
|
||||
int i;
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||
|
||||
if (create_tunnel_resp_pP) {
|
||||
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RX CREATE_TUNNEL_RESP num tunnels %u \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
create_tunnel_resp_pP->num_tunnels);
|
||||
|
||||
rnti = create_tunnel_resp_pP->rnti;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
RC.rrc[ctxt_pP->module_id],
|
||||
ctxt_pP->rnti);
|
||||
|
||||
for (i = 0; i < create_tunnel_resp_pP->num_tunnels; i++) {
|
||||
|
||||
// ue_context_p->ue_context.enb_gtp_teid[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
// ue_context_p->ue_context.enb_gtp_addrs[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->enb_addr;
|
||||
// ue_context_p->ue_context.enb_gtp_ebi[i+ue_context_p->ue_context.setup_e_rabs] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
ue_context_p->ue_context.enb_gtp_teid[inde_list[i]] = create_tunnel_resp_pP->enb_S1u_teid[i];
|
||||
ue_context_p->ue_context.enb_gtp_addrs[inde_list[i]] = create_tunnel_resp_pP->enb_addr;
|
||||
ue_context_p->ue_context.enb_gtp_ebi[inde_list[i]] = create_tunnel_resp_pP->eps_bearer_id[i];
|
||||
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP tunnel (%u, %u) bearer UE context index %u, msg index %u, id %u, gtp addr len %d \n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
create_tunnel_resp_pP->enb_S1u_teid[i],
|
||||
@@ -83,6 +71,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
create_tunnel_resp_pP->eps_bearer_id[i],
|
||||
create_tunnel_resp_pP->enb_addr.length);
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
@@ -123,4 +112,3 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
|
||||
}
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(enb_mod_idP), msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -30,10 +30,6 @@
|
||||
#ifndef RRC_ENB_GTPV1U_H_
|
||||
#define RRC_ENB_GTPV1U_H_
|
||||
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
|
||||
/*! \fn rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(const protocol_ctxt_t* const ctxt_pP, const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP)
|
||||
*\brief Process GTPV1U_ENB_CREATE_TUNNEL_RESP message received from GTPV1U, retrieve the enb teid created.
|
||||
@@ -42,8 +38,8 @@
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved. */
|
||||
int
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
);
|
||||
|
||||
@@ -57,6 +53,4 @@ void rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ(
|
||||
const rrc_eNB_ue_context_t* const ue_context_pP
|
||||
);
|
||||
|
||||
# endif
|
||||
# endif /* defined(ENABLE_USE_MME) */
|
||||
#endif /* RRC_ENB_GTPV1U_H_ */
|
||||
|
||||
+24
-123
@@ -27,7 +27,7 @@
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
*/
|
||||
#if defined(ENABLE_USE_MME)
|
||||
|
||||
# include "rrc_defs.h"
|
||||
# include "rrc_extern.h"
|
||||
# include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
@@ -41,20 +41,14 @@
|
||||
# include "s1ap_eNB_defs.h"
|
||||
# include "s1ap_eNB_management_procedures.h"
|
||||
# include "s1ap_eNB_ue_context.h"
|
||||
#include "asn1_conversions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_primitives.h"
|
||||
#include "s1ap_eNB.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "asn1_conversions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_primitives.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#else
|
||||
#include "../../S1AP/s1ap_eNB.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_SECURITY)
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#endif
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include "LTE_UERadioAccessCapabilityInformation.h"
|
||||
@@ -71,7 +65,7 @@ extern RAN_CONTEXT_t RC;
|
||||
extern int
|
||||
gtpv1u_delete_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_delete_tunnel_req_t * const req_pP);
|
||||
const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
|
||||
|
||||
/* Value to indicate an invalid UE initial id */
|
||||
static const uint16_t UE_INITIAL_ID_INVALID = 0;
|
||||
@@ -164,7 +158,7 @@ void extract_imsi(uint8_t *pdu_buf, uint32_t pdu_len, rrc_eNB_ue_context_t *ue_c
|
||||
}
|
||||
}
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
* Get the UE S1 struct containing hashtables S1_id/UE_id.
|
||||
@@ -222,7 +216,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
result2->ue_initial_id,
|
||||
result->eNB_ue_s1ap_id,
|
||||
result2->eNB_ue_s1ap_id);
|
||||
|
||||
// Still return *result
|
||||
}
|
||||
}
|
||||
@@ -231,7 +224,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in initial_id2_s1ap_ids ue_initial_id %"PRIu16"\n",
|
||||
rrc_instance_pP - RC.rrc[0],
|
||||
ue_initial_id);
|
||||
|
||||
return NULL;
|
||||
/*
|
||||
* At the moment this is written, this case shouldn't (cannot) happen and is equivalent to an error.
|
||||
@@ -261,7 +253,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
} else {
|
||||
LOG_E(S1AP, "[eNB instance %d] Couldn't find the eNB S1AP context\n",
|
||||
instance);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -285,7 +276,6 @@ rrc_eNB_S1AP_get_ue_ids(
|
||||
LOG_E(S1AP, "[eNB %ld] In hashtable_get, couldn't find in s1ap_id2_s1ap_ids eNB_ue_s1ap_id %"PRIu32", even when looking at S1AP context\n",
|
||||
rrc_instance_pP - RC.rrc[0],
|
||||
eNB_ue_s1ap_id);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
} // end if (h_rc != HASH_TABLE_OK)
|
||||
@@ -306,7 +296,6 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
if (rrc_instance_pP == NULL) {
|
||||
@@ -318,8 +307,10 @@ rrc_eNB_S1AP_remove_ue_ids(
|
||||
LOG_E(RRC, "Trying to free a NULL S1AP UE IDs\n");
|
||||
return;
|
||||
}
|
||||
|
||||
const uint16_t ue_initial_id = ue_ids_pP->ue_initial_id;
|
||||
const uint32_t eNB_ue_s1ap_id = ue_ids_pP->eNB_ue_s1ap_id;
|
||||
|
||||
if (eNB_ue_s1ap_id > 0) {
|
||||
h_rc = hashtable_remove(rrc_instance_pP->s1ap_id2_s1ap_ids, (hash_key_t)eNB_ue_s1ap_id);
|
||||
|
||||
@@ -493,7 +484,6 @@ static void process_eNB_security_key (
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
#if defined(ENABLE_SECURITY)
|
||||
char ascii_buffer[65];
|
||||
uint8_t i;
|
||||
/* Saves the security key */
|
||||
@@ -507,7 +497,6 @@ static void process_eNB_security_key (
|
||||
|
||||
ascii_buffer[2 * i] = '\0';
|
||||
LOG_I (RRC, "[eNB %d][UE %x] Saved security key %s\n", ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ascii_buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -520,7 +509,6 @@ rrc_pdcp_config_security(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
#if defined(ENABLE_SECURITY)
|
||||
LTE_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList;
|
||||
uint8_t *kRRCenc = NULL;
|
||||
uint8_t *kRRCint = NULL;
|
||||
@@ -578,8 +566,6 @@ rrc_pdcp_config_security(
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
DCCH);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -628,7 +614,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_e_rabs_failed = e_rabs_failed;
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
# endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
@@ -639,7 +624,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
LTE_ULInformationTransfer_t *ulInformationTransfer = &ul_dcch_msg->message.choice.c1.choice.ulInformationTransfer;
|
||||
|
||||
@@ -666,36 +650,6 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
LTE_ULInformationTransfer_t *ulInformationTransfer;
|
||||
ulInformationTransfer =
|
||||
&ul_dcch_msg->message.choice.c1.choice.
|
||||
ulInformationTransfer;
|
||||
|
||||
if (ulInformationTransfer->criticalExtensions.present ==
|
||||
LTE_ULInformationTransfer__criticalExtensions_PR_c1) {
|
||||
if (ulInformationTransfer->criticalExtensions.choice.c1.present ==
|
||||
LTE_ULInformationTransfer__criticalExtensions__c1_PR_ulInformationTransfer_r8) {
|
||||
ULInformationTransfer_r8_IEs_t
|
||||
*ulInformationTransferR8;
|
||||
ulInformationTransferR8 =
|
||||
&ulInformationTransfer->criticalExtensions.choice.
|
||||
c1.choice.ulInformationTransfer_r8;
|
||||
|
||||
if (ulInformationTransferR8->dedicatedInfoType.present ==
|
||||
LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS) {
|
||||
extract_imsi(ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.buf,
|
||||
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.size,
|
||||
ue_context_pP);
|
||||
s1ap_eNB_new_data_request (mod_id, ue_index,
|
||||
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.buf,
|
||||
ulInformationTransferR8->dedicatedInfoType.choice.dedicatedInfoNAS.size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -758,7 +712,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
eNB_RRC_INST *rrc = RC.rrc[ctxt_pP->module_id];
|
||||
#if defined(ENABLE_ITTI)
|
||||
{
|
||||
MessageDef *message_p = NULL;
|
||||
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
|
||||
@@ -846,13 +799,11 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code = BIT_STRING_to_uint8 (&r_mme->mmec);
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id = BIT_STRING_to_uint16 (&r_mme->mmegi);
|
||||
|
||||
ue_context_pP->ue_context.ue_gummei.mcc = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc;
|
||||
ue_context_pP->ue_context.ue_gummei.mnc = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc;
|
||||
ue_context_pP->ue_context.ue_gummei.mnc_len = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_code = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_group_id = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id;
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_S1AP_ENB,
|
||||
MSC_S1AP_MME,
|
||||
(const char *)&message_p->ittiMsg.s1ap_nas_first_req,
|
||||
@@ -870,20 +821,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
} // end "Fill UE identities with available information" sub-part
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, message_p);
|
||||
}
|
||||
#else
|
||||
{
|
||||
s1ap_eNB_new_data_request (
|
||||
ctxt_pP->module_id,
|
||||
ue_context_pP,
|
||||
rrcConnectionSetupComplete->dedicatedInfoNAS.
|
||||
buf,
|
||||
rrcConnectionSetupComplete->dedicatedInfoNAS.
|
||||
size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
int
|
||||
rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
@@ -1010,7 +950,6 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_INITIAL_CONTEXT_SETUP_REQ (msg_p).mme_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
int i;
|
||||
@@ -1842,7 +1781,6 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
uint32_t T; /* DRX cycle */
|
||||
|
||||
for (uint16_t tai_size = 0; tai_size < S1AP_PAGING_IND(msg_p).tai_size; tai_size++) {
|
||||
|
||||
LOG_D(RRC,"[eNB %d] In S1AP_PAGING_IND: MCC %d, MNC %d, TAC %d\n", instance, S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mcc,
|
||||
S1AP_PAGING_IND(msg_p).plmn_identity[tai_size].mnc, S1AP_PAGING_IND(msg_p).tac[tai_size]);
|
||||
|
||||
@@ -1865,6 +1803,7 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
T = Tc < Tue ? Ttab[Tc] : Ttab[Tue];
|
||||
/* set pcch_nB = PCCH-Config->nB */
|
||||
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_nB;
|
||||
|
||||
switch (pcch_nB) {
|
||||
case LTE_PCCH_Config__nB_fourT:
|
||||
Ns = 4;
|
||||
@@ -1990,95 +1929,76 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
}
|
||||
|
||||
/*NN: careful about the typcast of xid (long -> uint8_t*/
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP){
|
||||
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP) {
|
||||
MessageDef *msg_p = NULL;
|
||||
int e_rab = 0;
|
||||
int e_rabs_done = 0;
|
||||
|
||||
rrc_ue_s1ap_ids_t* rrc_ue_s1ap_ids_p = NULL;
|
||||
rrc_ue_s1ap_ids_t *rrc_ue_s1ap_ids_p = NULL;
|
||||
hashtable_rc_t h_rc;
|
||||
|
||||
gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
|
||||
uint8_t inde_list[ue_context_pP->ue_context.nb_of_e_rabs];
|
||||
memset(inde_list, 0, ue_context_pP->ue_context.nb_of_e_rabs*sizeof(uint8_t));
|
||||
|
||||
msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_PATH_SWITCH_REQ);
|
||||
|
||||
ue_context_pP->ue_context.ue_initial_id = get_next_ue_initial_id (ctxt_pP->module_id);
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
|
||||
rrc_ue_s1ap_ids_p = malloc(sizeof(*rrc_ue_s1ap_ids_p));
|
||||
rrc_ue_s1ap_ids_p->ue_initial_id = ue_context_pP->ue_context.ue_initial_id;
|
||||
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
|
||||
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
|
||||
|
||||
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
|
||||
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
|
||||
rrc_ue_s1ap_ids_p);
|
||||
|
||||
if (h_rc != HASH_TABLE_OK) {
|
||||
LOG_E(S1AP, "[eNB %d] Error while hashtable_insert in initial_id2_s1ap_ids ue_initial_id %u\n",
|
||||
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
|
||||
}
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).mme_ue_s1ap_id = ue_context_pP->ue_context.mme_ue_s1ap_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mcc = ue_context_pP->ue_context.ue_gummei.mcc;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mnc = ue_context_pP->ue_context.ue_gummei.mnc;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mnc_len = ue_context_pP->ue_context.ue_gummei.mnc_len;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mme_code = ue_context_pP->ue_context.ue_gummei.mme_code;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).ue_gummei.mme_group_id = ue_context_pP->ue_context.ue_gummei.mme_group_id;
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.encryption_algorithms=ue_context_pP->ue_context.security_capabilities.encryption_algorithms;
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.integrity_algorithms=ue_context_pP->ue_context.security_capabilities.integrity_algorithms;
|
||||
|
||||
LOG_I (RRC,"Path switch request: nb nb_of_e_rabs %u status %u\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
ue_context_pP->ue_context.e_rab[e_rab].status);
|
||||
memset(&create_tunnel_req, 0, sizeof(create_tunnel_req));
|
||||
|
||||
memset(&create_tunnel_req, 0 , sizeof(create_tunnel_req));
|
||||
// the context for UE to be handovered is obtained through ho_req message
|
||||
for (e_rab = 0; e_rab < ue_context_pP->ue_context.nb_of_e_rabs ; e_rab++) {
|
||||
|
||||
if (ue_context_pP->ue_context.e_rab[e_rab].status == E_RAB_STATUS_ESTABLISHED) {
|
||||
|
||||
create_tunnel_req.eps_bearer_id[e_rabs_done] = ue_context_pP->ue_context.e_rab[e_rab].param.e_rab_id;
|
||||
create_tunnel_req.sgw_S1u_teid[e_rabs_done] = ue_context_pP->ue_context.e_rab[e_rab].param.gtp_teid;
|
||||
memcpy(&create_tunnel_req.sgw_addr[e_rabs_done],
|
||||
&ue_context_pP->ue_context.e_rab[e_rab].param.sgw_addr,
|
||||
sizeof(transport_layer_addr_t));
|
||||
|
||||
inde_list[e_rabs_done] = e_rab;
|
||||
e_rabs_done++;
|
||||
}
|
||||
}
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
|
||||
create_tunnel_req.rnti = ue_context_pP->ue_context.rnti;
|
||||
create_tunnel_req.num_tunnels = e_rabs_done;
|
||||
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
ctxt_pP,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
|
||||
for (e_rab = 0; e_rab < e_rabs_done; e_rab++) {
|
||||
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid = create_tunnel_resp.enb_S1u_teid[e_rab];
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
|
||||
|
||||
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
|
||||
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
|
||||
ue_context_pP->ue_context.nb_of_e_rabs,
|
||||
@@ -2092,10 +2012,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
// NN: add conditions for e_rabs_failed
|
||||
if (e_rabs_done > 0) {
|
||||
|
||||
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
@@ -2106,27 +2024,21 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done);
|
||||
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
{
|
||||
int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance) {
|
||||
uint16_t ue_initial_id;
|
||||
uint32_t eNB_ue_s1ap_id;
|
||||
//gtpv1u_enb_create_tunnel_req_t create_tunnel_req;
|
||||
//gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
|
||||
|
||||
gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req;
|
||||
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
|
||||
protocol_ctxt_t ctxt;
|
||||
int i;
|
||||
|
||||
ue_initial_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_initial_id;
|
||||
eNB_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p = rrc_eNB_get_ue_context_from_s1ap_ids(instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
@@ -2136,22 +2048,16 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
if (ue_context_p == NULL) {
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
//MessageDef *msg_fail_p = NULL;
|
||||
|
||||
LOG_W(RRC, "[eNB %d] In S1AP_PATH_SWITCH_REQ_ACK: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
|
||||
//msg_fail_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_PATH_SWITCH_REQ_ACK_FAIL);
|
||||
//S1AP_PATH_SWITCH_REQ_ACK (msg_fail_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
|
||||
// TODO add failure cause when defined!
|
||||
|
||||
//itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
} else {
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).eNB_ue_s1ap_id;
|
||||
ue_context_p->ue_context.mme_ue_s1ap_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).mme_ue_s1ap_id;
|
||||
|
||||
/* Save e RAB information for later */
|
||||
{
|
||||
for (i = 0;
|
||||
@@ -2181,21 +2087,19 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
ue_context_p->ue_context.setup_e_rabs=i;
|
||||
ue_context_p->ue_context.nb_of_e_rabs=i;
|
||||
}
|
||||
|
||||
ue_context_p->ue_context.ue_ambr=S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_ambr;
|
||||
|
||||
|
||||
ue_context_p->ue_context.nb_release_of_e_rabs = S1AP_PATH_SWITCH_REQ_ACK (msg_p).nb_e_rabs_tobereleased;
|
||||
memset(&delete_tunnel_req, 0 , sizeof(delete_tunnel_req));
|
||||
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
|
||||
|
||||
for (i = 0;
|
||||
i < ue_context_p->ue_context.nb_release_of_e_rabs;
|
||||
i++) {
|
||||
LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
|
||||
ue_context_p->ue_context.e_rabs_tobereleased[i]=S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id;
|
||||
delete_tunnel_req.eps_bearer_id[i] = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[i].e_rab_id;
|
||||
|
||||
}
|
||||
if (ue_context_p->ue_context.nb_release_of_e_rabs>0){
|
||||
|
||||
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) {
|
||||
delete_tunnel_req.rnti= ue_context_p->ue_context.rnti;
|
||||
delete_tunnel_req.num_erab= ue_context_p->ue_context.nb_release_of_e_rabs;
|
||||
/* this could also be done through ITTI message */
|
||||
@@ -2210,10 +2114,7 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg
|
||||
memcpy ( ue_context_p->ue_context.next_security_key,
|
||||
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
|
||||
SECURITY_KEY_LENGTH);
|
||||
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
# endif /* defined(ENABLE_ITTI) */
|
||||
#endif /* defined(ENABLE_USE_MME) */
|
||||
|
||||
@@ -31,13 +31,10 @@
|
||||
#ifndef RRC_ENB_S1AP_H_
|
||||
#define RRC_ENB_S1AP_H_
|
||||
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
#include "LTE_UL-DCCH-Message.h"
|
||||
|
||||
/* Up link procedures */
|
||||
|
||||
# if defined(ENABLE_ITTI)
|
||||
typedef struct rrc_ue_s1ap_ids_s {
|
||||
/* Tree related data */
|
||||
RB_ENTRY(rrc_ue_s1ap_ids_s) entries;
|
||||
@@ -52,36 +49,36 @@ typedef struct rrc_ue_s1ap_ids_s {
|
||||
|
||||
int
|
||||
rrc_eNB_S1AP_compare_ue_ids(
|
||||
struct rrc_ue_s1ap_ids_s* c1_pP,
|
||||
struct rrc_ue_s1ap_ids_s* c2_pP
|
||||
struct rrc_ue_s1ap_ids_s *c1_pP,
|
||||
struct rrc_ue_s1ap_ids_s *c2_pP
|
||||
);
|
||||
|
||||
struct rrc_rnti_tree_s;
|
||||
|
||||
RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids);
|
||||
|
||||
struct rrc_ue_s1ap_ids_s*
|
||||
struct rrc_ue_s1ap_ids_s *
|
||||
rrc_eNB_S1AP_get_ue_ids(
|
||||
eNB_RRC_INST* const rrc_instance_pP,
|
||||
eNB_RRC_INST *const rrc_instance_pP,
|
||||
const uint16_t ue_initial_id,
|
||||
const uint32_t eNB_ue_s1ap_id
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_S1AP_remove_ue_ids(
|
||||
eNB_RRC_INST* const rrc_instance_pP,
|
||||
struct rrc_ue_s1ap_ids_s* const ue_ids_pP
|
||||
eNB_RRC_INST *const rrc_instance_pP,
|
||||
struct rrc_ue_s1ap_ids_s *const ue_ids_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
int
|
||||
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
@@ -92,8 +89,8 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t* cons
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
/*! \fn void rrc_eNB_send_S1AP_UPLINK_NAS(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t * const ul_dcch_msg)
|
||||
@@ -104,9 +101,9 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t* const ul_dcch_msg
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t *const ul_dcch_msg
|
||||
);
|
||||
|
||||
/*! \fn void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(const protocol_ctxt_t * const ctxt_pP, eNB_RRC_UE_t * const ue_context_pP, UL_DCCH_Message_t *ul_dcch_msg)
|
||||
@@ -116,9 +113,9 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
|
||||
*\param ul_dcch_msg The message receive by RRC holding the NAS message.
|
||||
*/
|
||||
void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t* ul_dcch_msg
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_UL_DCCH_Message_t *ul_dcch_msg
|
||||
);
|
||||
|
||||
/*! \fn rrc_eNB_send_S1AP_NAS_FIRST_REQ(const protocol_ctxt_t* const ctxt_pP,eNB_RRC_UE_t *const ue_context_pP, RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete)
|
||||
@@ -130,9 +127,9 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete
|
||||
);
|
||||
|
||||
|
||||
@@ -146,7 +143,7 @@ the UE-associated S1-logical connection over the S1 interface. .
|
||||
*/
|
||||
void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ (
|
||||
const module_id_t enb_mod_idP,
|
||||
const rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const s1ap_Cause_t causeP,
|
||||
const long cause_valueP
|
||||
);
|
||||
@@ -199,7 +196,7 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
*\brief process a S1AP dedicated E_RAB modify request message received from S1AP.
|
||||
@@ -217,7 +214,7 @@ int rrc_eNB_process_S1AP_E_RAB_MODIFY_REQ(MessageDef *msg_p, const char *msg_nam
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
|
||||
|
||||
/*! \fn rrc_eNB_process_S1AP_UE_CTXT_MODIFICATION_REQ(MessageDef *msg_p, const char *msg_name, instance_t instance)
|
||||
*\brief process a S1AP_UE_CTXT_MODIFICATION_REQ message received from S1AP.
|
||||
@@ -257,8 +254,8 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
|
||||
|
||||
void
|
||||
rrc_pdcp_config_security(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t send_security_mode_command
|
||||
);
|
||||
/*! \fn rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
@@ -277,12 +274,10 @@ int rrc_eNB_process_S1AP_E_RAB_RELEASE_COMMAND(MessageDef *msg_p, const char *ms
|
||||
*\param xid transaction identifier
|
||||
*\return 0 when successful, -1 if the UE index can not be retrieved.
|
||||
*/
|
||||
int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t* const ctxt_pP, rrc_eNB_ue_context_t* const ue_context_pP, uint8_t xid );
|
||||
int rrc_eNB_send_S1AP_E_RAB_RELEASE_RESPONSE(const protocol_ctxt_t *const ctxt_pP, rrc_eNB_ue_context_t *const ue_context_pP, uint8_t xid );
|
||||
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP);
|
||||
int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP);
|
||||
int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p, const char *msg_name, instance_t instance);
|
||||
|
||||
# endif
|
||||
# endif /* defined(ENABLE_USE_MME) */
|
||||
#endif /* RRC_ENB_S1AP_H_ */
|
||||
|
||||
+101
-103
@@ -39,12 +39,13 @@
|
||||
int rrc_init_global_param(void);
|
||||
int L3_xface_init(void);
|
||||
void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,uint8_t HO_enabled);
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
char
|
||||
openair_rrc_eNB_configuration(
|
||||
const module_id_t enb_mod_idP, RrcConfigurationReq *rrc_configuration_req
|
||||
const module_id_t enb_mod_idP,
|
||||
RrcConfigurationReq *configuration
|
||||
);
|
||||
#endif
|
||||
|
||||
char openair_rrc_eNB_init(
|
||||
const module_id_t module_idP);
|
||||
|
||||
@@ -54,10 +55,10 @@ char openair_rrc_ue_init(
|
||||
void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role);
|
||||
void
|
||||
openair_rrc_on(
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
void
|
||||
openair_rrc_on_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP);
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
void rrc_top_cleanup(void);
|
||||
|
||||
@@ -68,7 +69,7 @@ void rrc_top_cleanup(void);
|
||||
*/
|
||||
RRC_status_t
|
||||
rrc_rx_tx(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -79,7 +80,7 @@ rrc_rx_tx(
|
||||
*/
|
||||
RRC_status_t
|
||||
rrc_rx_tx_ue(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t enb_index,
|
||||
const int CC_id
|
||||
);
|
||||
@@ -90,7 +91,7 @@ rrc_rx_tx_ue(
|
||||
\param ctxt_pP Running context
|
||||
\param Srb_info Pointer to SRB_INFO structure (SRB0)
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* const Srb_info, const uint8_t eNB_index );
|
||||
int rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const SRB_INFO *const Srb_info, const uint8_t eNB_index );
|
||||
|
||||
/** \brief Decodes a DL-DCCH message and invokes appropriate routine to handle the message
|
||||
\param ctxt_pP Running context
|
||||
@@ -99,17 +100,17 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* co
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_decode_dcch(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t* const Buffer,
|
||||
const uint8_t *const Buffer,
|
||||
const uint8_t eNB_indexP
|
||||
);
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int decode_SL_Discovery_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
const uint8_t* Sdu,
|
||||
const uint8_t *Sdu,
|
||||
const uint8_t Sdu_len);
|
||||
#endif
|
||||
|
||||
@@ -118,7 +119,7 @@ int decode_SL_Discovery_Message(
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_generate_RRCConnectionRequest(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -128,8 +129,8 @@ rrc_ue_generate_RRCConnectionRequest(
|
||||
\param eNB_index Index of corresponding eNB/CH*/
|
||||
void
|
||||
rrc_ue_process_rrcConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
LTE_RRCConnectionReconfiguration_t* rrcConnectionReconfiguration,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
LTE_RRCConnectionReconfiguration_t *rrcConnectionReconfiguration,
|
||||
uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -163,9 +164,9 @@ int32_t rrc_ue_establish_drb(module_id_t module_idP,frame_t frameP,uint8_t eNB_
|
||||
*/
|
||||
void
|
||||
rrc_ue_process_mobilityControlInfo(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
struct LTE_MobilityControlInfo* const mobilityControlInfo
|
||||
struct LTE_MobilityControlInfo *const mobilityControlInfo
|
||||
);
|
||||
|
||||
/** \brief Process a measConfig Message and configure PHY/MAC
|
||||
@@ -174,9 +175,9 @@ rrc_ue_process_mobilityControlInfo(
|
||||
\param measConfig Pointer to MeasConfig IE from configuration*/
|
||||
void
|
||||
rrc_ue_process_measConfig(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
LTE_MeasConfig_t* const measConfig
|
||||
LTE_MeasConfig_t *const measConfig
|
||||
);
|
||||
|
||||
/** \brief Process a RadioResourceConfigDedicated Message and configure PHY/MAC
|
||||
@@ -184,7 +185,7 @@ rrc_ue_process_measConfig(
|
||||
\param eNB_index Index of corresponding CH/eNB
|
||||
\param radioResourceConfigDedicated Pointer to RadioResourceConfigDedicated IE from configuration*/
|
||||
void rrc_ue_process_radioResourceConfigDedicated(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
uint8_t eNB_index,
|
||||
LTE_RadioResourceConfigDedicated_t *radioResourceConfigDedicated);
|
||||
|
||||
@@ -201,8 +202,8 @@ void rrc_ue_process_sidelink_radioResourceConfig(
|
||||
uint8_t eNB_index,
|
||||
LTE_SystemInformationBlockType18_r12_t *sib18,
|
||||
LTE_SystemInformationBlockType19_r12_t *sib19,
|
||||
LTE_SL_CommConfig_r12_t* sl_CommConfig,
|
||||
LTE_SL_DiscConfig_r12_t* sl_DiscConfig);
|
||||
LTE_SL_CommConfig_r12_t *sl_CommConfig,
|
||||
LTE_SL_DiscConfig_r12_t *sl_DiscConfig);
|
||||
|
||||
/** \brief Init control socket to listen to incoming packets from ProSe App
|
||||
*
|
||||
@@ -222,12 +223,10 @@ uint8_t rrc_eNB_get_next_transaction_identifier(module_id_t module_idP);
|
||||
\param buffer Pointer to SDU
|
||||
\param buffer_length length of SDU in bytes
|
||||
\param CC_id component carrier index*/
|
||||
|
||||
int rrc_eNB_decode_ccch(protocol_ctxt_t* const ctxt_pP,
|
||||
const uint8_t *buffer,
|
||||
int buffer_length,
|
||||
const int CC_id
|
||||
);
|
||||
int buffer_length,
|
||||
const int CC_id);
|
||||
|
||||
/**\brief Entry routine to decode a UL-DCCH-Message. Invokes PER decoder and parses message.
|
||||
\param ctxt_pP Context
|
||||
@@ -235,9 +234,9 @@ int rrc_eNB_decode_ccch(protocol_ctxt_t* const ctxt_pP,
|
||||
\param sdu_size Size of incoming SDU*/
|
||||
int
|
||||
rrc_eNB_decode_dcch(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t* const Rx_sdu,
|
||||
const uint8_t *const Rx_sdu,
|
||||
const sdu_size_t sdu_sizeP
|
||||
);
|
||||
|
||||
@@ -246,8 +245,8 @@ rrc_eNB_decode_dcch(
|
||||
\param ue_context_pP UE context*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionSetup(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -257,8 +256,8 @@ rrc_eNB_generate_RRCConnectionSetup(
|
||||
\param CC_id Component Carrier ID*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const int CC_id
|
||||
);
|
||||
|
||||
@@ -268,9 +267,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
\param rrcConnectionSetupComplete Pointer to RRCConnectionSetupComplete message*/
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t* rrcConnectionSetupComplete
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
LTE_RRCConnectionSetupComplete_r8_IEs_t *rrcConnectionSetupComplete
|
||||
);
|
||||
|
||||
/**\brief Process the RRCConnectionReconfigurationComplete based on information coming from UE
|
||||
@@ -281,8 +280,8 @@ rrc_eNB_process_RRCConnectionSetupComplete(
|
||||
*/
|
||||
void
|
||||
rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
const uint8_t xid
|
||||
);
|
||||
|
||||
@@ -291,41 +290,41 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
\param ue_context_pP UE context of UE receiving the message*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionRelease(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state,
|
||||
agent_reconf_rrc * trig_param
|
||||
);
|
||||
agent_reconf_rrc *trig_param
|
||||
);
|
||||
void
|
||||
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* buffer,
|
||||
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *buffer,
|
||||
int *_size
|
||||
//const uint8_t ho_state
|
||||
);
|
||||
void
|
||||
rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s* ue_context_p, protocol_ctxt_t* const ctxt_pP);
|
||||
rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protocol_ctxt_t *const ctxt_pP);
|
||||
|
||||
int freq_to_arfcn10(int band, unsigned long freq);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
const uint8_t ho_state
|
||||
);
|
||||
|
||||
@@ -334,18 +333,18 @@ rrc_eNB_generate_dedeicatedRRCConnectionReconfiguration(
|
||||
\param ue_context_pP UE context of UE receiving the message*/
|
||||
void
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t xid,
|
||||
uint32_t nas_length,
|
||||
uint8_t* nas_buffer
|
||||
uint8_t *nas_buffer
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP);
|
||||
rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP);
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
void rrc_enb_init(void);
|
||||
void *rrc_enb_process_itti_msg(void *);
|
||||
@@ -357,7 +356,7 @@ void *rrc_enb_task(void *args_p);
|
||||
/**\brief RRC UE task.
|
||||
\param void *args_p Pointer on arguments to start the task. */
|
||||
void *rrc_ue_task(void *args_p);
|
||||
#endif
|
||||
|
||||
|
||||
void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m);
|
||||
|
||||
@@ -367,9 +366,9 @@ void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_re
|
||||
\param ue_module_idP Index of UE transmitting the messages*/
|
||||
void
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* const nas_pdu,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *const nas_pdu,
|
||||
const uint32_t nas_length
|
||||
);
|
||||
|
||||
@@ -380,8 +379,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
|
||||
\param n_discoveryMessages Number of discovery messages*/
|
||||
int
|
||||
rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList,
|
||||
int n_discoveryMessages
|
||||
);
|
||||
@@ -391,9 +390,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_Sidelink(
|
||||
\param sidelinkUEInformation sidelinkUEInformation message from UE*/
|
||||
uint8_t
|
||||
rrc_eNB_process_SidelinkUEInformation(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
LTE_SidelinkUEInformation_r12_t* sidelinkUEInformation
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
LTE_SidelinkUEInformation_r12_t *sidelinkUEInformation
|
||||
);
|
||||
|
||||
/** \brief Get a Resource Pool to transmit SL communication
|
||||
@@ -401,8 +400,8 @@ rrc_eNB_process_SidelinkUEInformation(
|
||||
\param ue_context_pP UE context
|
||||
\param destinationInfoList Pointer to the list of SL destinations*/
|
||||
LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
LTE_SL_DestinationInfoList_r12_t *destinationInfoList
|
||||
);
|
||||
|
||||
@@ -411,8 +410,8 @@ LTE_SL_CommConfig_r12_t rrc_eNB_get_sidelink_commTXPool(
|
||||
\param ue_context_pP UE context
|
||||
\param n_discoveryMessages Number of discovery messages*/
|
||||
LTE_SL_DiscConfig_r12_t rrc_eNB_get_sidelink_discTXPool(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
int n_discoveryMessages
|
||||
);
|
||||
|
||||
@@ -430,7 +429,7 @@ mac_rrc_data_req(
|
||||
const rb_id_t Srb_id,
|
||||
const rnti_t rnti,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
);
|
||||
|
||||
@@ -443,7 +442,7 @@ mac_rrc_data_ind(
|
||||
const int UE_id,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t* sduP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const uint8_t mbsfn_sync_areaP
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
@@ -458,7 +457,7 @@ mac_rrc_data_req_ue(
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
);
|
||||
@@ -471,7 +470,7 @@ mac_rrc_data_ind_ue(
|
||||
const sub_frame_t sub_frameP,
|
||||
const rnti_t rntiP,
|
||||
const rb_id_t srb_idP,
|
||||
const uint8_t* sduP,
|
||||
const uint8_t *sduP,
|
||||
const sdu_size_t sdu_lenP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_areaP
|
||||
@@ -499,65 +498,65 @@ void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
|
||||
uint8_t
|
||||
rrc_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_size,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
uint8_t
|
||||
|
||||
rrc_data_req_ue(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t* const buffer_pP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t* const buffer_pP
|
||||
const uint8_t *const buffer_pP
|
||||
);
|
||||
|
||||
void rrc_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
|
||||
|
||||
void rrc_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
|
||||
|
||||
int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
|
||||
int decode_MCCH_Message( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_index, const uint8_t *const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
|
||||
|
||||
int decode_BCCH_DLSCH_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
uint8_t* const Sdu,
|
||||
uint8_t *const Sdu,
|
||||
const uint8_t Sdu_len,
|
||||
const uint8_t rsrq,
|
||||
const uint8_t rsrp );
|
||||
|
||||
int decode_PCCH_DLSCH_Message(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index,
|
||||
uint8_t* const Sdu,
|
||||
uint8_t *const Sdu,
|
||||
const uint8_t Sdu_len);
|
||||
|
||||
void
|
||||
ue_meas_filtering(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
void
|
||||
ue_measurement_report_triggering(
|
||||
protocol_ctxt_t* const ctxt_pP,
|
||||
protocol_ctxt_t *const ctxt_pP,
|
||||
const uint8_t eNB_index
|
||||
);
|
||||
|
||||
@@ -575,35 +574,35 @@ mac_UE_get_rrc_status(
|
||||
|
||||
void
|
||||
rrc_eNB_generate_UECapabilityEnquiry(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_SecurityModeCommand(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_process_MeasurementReport(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* ue_context_pP,
|
||||
const LTE_MeasResults_t* const measResults2
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_eNB_ue_context_t *ue_context_pP,
|
||||
const LTE_MeasResults_t *const measResults2
|
||||
);
|
||||
|
||||
void
|
||||
rrc_eNB_generate_HandoverPreparationInformation(
|
||||
//const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_ue_context_t* const ue_context_pP,
|
||||
uint8_t* buffer,
|
||||
rrc_eNB_ue_context_t *const ue_context_pP,
|
||||
uint8_t *buffer,
|
||||
int *_size
|
||||
//LTE_PhysCellId_t targetPhyId
|
||||
);
|
||||
|
||||
void
|
||||
check_handovers(
|
||||
protocol_ctxt_t* const ctxt_pP
|
||||
protocol_ctxt_t *const ctxt_pP
|
||||
);
|
||||
|
||||
//void rrc_ue_process_ueCapabilityEnquiry(uint8_t module_idP,uint32_t frame,UECapabilityEnquiry_t *UECapabilityEnquiry,uint8_t eNB_index);
|
||||
@@ -615,7 +614,6 @@ rrc_ue_process_securityModeCommand(
|
||||
);
|
||||
*/
|
||||
|
||||
#if !defined(ENABLE_USE_MME)
|
||||
void rrc_eNB_emulation_notify_ue_module_id(
|
||||
const module_id_t ue_module_idP,
|
||||
const rnti_t rntiP,
|
||||
@@ -623,20 +621,20 @@ void rrc_eNB_emulation_notify_ue_module_id(
|
||||
const uint8_t cell_identity_byte1P,
|
||||
const uint8_t cell_identity_byte2P,
|
||||
const uint8_t cell_identity_byte3P);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void
|
||||
rrc_eNB_free_mem_UE_context(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
struct rrc_eNB_ue_context_s* const ue_context_pP
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
struct rrc_eNB_ue_context_s *const ue_context_pP
|
||||
);
|
||||
|
||||
|
||||
void
|
||||
rrc_eNB_free_UE(
|
||||
const module_id_t enb_mod_idP,
|
||||
const struct rrc_eNB_ue_context_s* const ue_context_pP
|
||||
const struct rrc_eNB_ue_context_s *const ue_context_pP
|
||||
);
|
||||
|
||||
long binary_search_int(int elements[], long numElem, int value);
|
||||
@@ -647,7 +645,7 @@ void openair_rrc_top_init_eNB(int eMBMS_active,uint8_t HO_active);
|
||||
|
||||
void openair_rrc_top_init_ue(
|
||||
int eMBMS_active,
|
||||
char* uecap_xer,
|
||||
char *uecap_xer,
|
||||
uint8_t cba_group_active,
|
||||
uint8_t HO_active
|
||||
);
|
||||
|
||||
+7
-13
@@ -39,10 +39,8 @@
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "platform_types.h"
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
# include "s1ap_eNB.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@@ -135,8 +133,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
* \enddot
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
STATE_START_OCG, /*!< \brief initiate OCG */
|
||||
STATE_GET_OPT, /*!< \brief get options of OCG command */
|
||||
STATE_DETECT_FILE, /*!< \brief detect the configuration file in folder USER_XML_FOLDER */
|
||||
@@ -571,7 +568,7 @@ typedef struct {
|
||||
} Layer;
|
||||
|
||||
typedef struct {
|
||||
char * level;
|
||||
char *level;
|
||||
char *verbosity;
|
||||
int interval;
|
||||
} Log_Emu;
|
||||
@@ -598,8 +595,8 @@ typedef struct {
|
||||
Log_Emu log_emu;
|
||||
Packet_Trace packet_trace;
|
||||
Seed seed;
|
||||
char * curve;
|
||||
char * background_stats;
|
||||
char *curve;
|
||||
char *background_stats;
|
||||
// CLI tags are in Info
|
||||
//char g_log_level[20];
|
||||
} Emulation_Config;
|
||||
@@ -677,7 +674,7 @@ typedef struct {
|
||||
unsigned char cba_group_active;
|
||||
unsigned char cba_backoff;
|
||||
unsigned char handover_active;
|
||||
char * otg_traffic;
|
||||
char *otg_traffic;
|
||||
unsigned char otg_bg_traffic_enabled;
|
||||
unsigned char omg_model_rn;
|
||||
unsigned char omg_model_enb;
|
||||
@@ -705,7 +702,7 @@ typedef struct {
|
||||
node_function_t node_function[MAX_NUM_CCs];
|
||||
node_timing_t node_timing[MAX_NUM_CCs];
|
||||
unsigned char frame_type[MAX_NUM_CCs]; //! LTE frame type (TDD=1, FDD=0). \note this should be converted to \ref lte_frame_type_t (header file reorganization needed)
|
||||
char * frame_type_name[MAX_NUM_CCs];
|
||||
char *frame_type_name[MAX_NUM_CCs];
|
||||
unsigned char tdd_config[MAX_NUM_CCs];
|
||||
unsigned char tdd_config_S[MAX_NUM_CCs];
|
||||
unsigned char extended_prefix_flag[MAX_NUM_CCs];
|
||||
@@ -713,10 +710,7 @@ typedef struct {
|
||||
unsigned char transmission_mode[MAX_NUM_CCs];
|
||||
int max_predefined_traffic_config_index;
|
||||
int max_customized_traffic_config_index;
|
||||
|
||||
#if defined(ENABLE_USE_MME)
|
||||
s1ap_eNB_config_t s1ap_config;
|
||||
#endif
|
||||
|
||||
/* Per-Slot ISR
|
||||
* Interval between two ISR = 500usec
|
||||
|
||||
@@ -619,7 +619,7 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_data_t *x2ap_eNB_data_p,
|
||||
ie = (X2AP_HandoverRequestAcknowledge_IEs_t *)calloc(1, sizeof(X2AP_HandoverRequestAcknowledge_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID_1;
|
||||
ie->value.present = X2AP_HandoverRequestAcknowledge_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = 0;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
@@ -708,7 +708,7 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
ie = (X2AP_UEContextRelease_IEs_t *)calloc(1, sizeof(X2AP_UEContextRelease_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_New_eNB_UE_X2AP_ID;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID_1;
|
||||
ie->value.present = X2AP_UEContextRelease_IEs__value_PR_UE_X2AP_ID;
|
||||
ie->value.choice.UE_X2AP_ID = 0;
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ Description Defines EPS Mobility Management messages
|
||||
#include "TLVDecoder.h"
|
||||
#include "TLVEncoder.h"
|
||||
|
||||
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
|
||||
# include "nas_itti_messaging.h"
|
||||
#endif
|
||||
|
||||
#include "nas_itti_messaging.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/**************** E X T E R N A L D E F I N I T I O N S ****************/
|
||||
@@ -83,25 +82,18 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
|
||||
LOG_FUNC_IN;
|
||||
|
||||
int header_result;
|
||||
int decode_result;
|
||||
|
||||
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
|
||||
uint8_t *buffer_log = buffer;
|
||||
uint32_t len_log = len;
|
||||
int down_link;
|
||||
|
||||
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
|
||||
down_link = 0;
|
||||
# else
|
||||
down_link = 1;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* First decode the EMM message header */
|
||||
header_result = _emm_msg_decode_header(&msg->header, buffer, len);
|
||||
|
||||
@@ -113,144 +105,143 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
|
||||
buffer += header_result;
|
||||
len -= header_result;
|
||||
|
||||
LOG_TRACE(INFO, "EMM-MSG - Message Type 0x%02x", msg->header.message_type);
|
||||
|
||||
switch(msg->header.message_type) {
|
||||
case EMM_INFORMATION:
|
||||
decode_result = decode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
case EMM_INFORMATION:
|
||||
decode_result = decode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REJECT:
|
||||
decode_result = decode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REJECT:
|
||||
decode_result = decode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_FAILURE:
|
||||
decode_result = decode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_FAILURE:
|
||||
decode_result = decode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DETACH_ACCEPT:
|
||||
decode_result = decode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
case DETACH_ACCEPT:
|
||||
decode_result = decode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REJECT:
|
||||
decode_result = decode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
case SERVICE_REJECT:
|
||||
decode_result = decode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REQUEST:
|
||||
decode_result = decode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REQUEST:
|
||||
decode_result = decode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
decode_result = decode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
decode_result = decode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REQUEST:
|
||||
decode_result = decode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
case ATTACH_REQUEST:
|
||||
decode_result = decode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case EMM_STATUS:
|
||||
decode_result = decode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
case EMM_STATUS:
|
||||
decode_result = decode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_RESPONSE:
|
||||
decode_result = decode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
case IDENTITY_RESPONSE:
|
||||
decode_result = decode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_REQUEST:
|
||||
decode_result = decode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
case IDENTITY_REQUEST:
|
||||
decode_result = decode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
decode_result = decode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
decode_result = decode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
decode_result = decode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
decode_result = decode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_ACCEPT:
|
||||
decode_result = decode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
case ATTACH_ACCEPT:
|
||||
decode_result = decode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
decode_result = decode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
decode_result = decode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
decode_result = decode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
decode_result = decode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REJECT:
|
||||
decode_result = decode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
case ATTACH_REJECT:
|
||||
decode_result = decode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_COMPLETE:
|
||||
decode_result = decode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
case ATTACH_COMPLETE:
|
||||
decode_result = decode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
decode_result = decode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
decode_result = decode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
decode_result = decode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
decode_result = decode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_REJECT:
|
||||
decode_result = decode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
case SECURITY_MODE_REJECT:
|
||||
decode_result = decode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case DETACH_REQUEST:
|
||||
decode_result = decode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
case DETACH_REQUEST:
|
||||
decode_result = decode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
decode_result = decode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
decode_result = decode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMMAND:
|
||||
decode_result = decode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMMAND:
|
||||
decode_result = decode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
decode_result = decode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
decode_result = decode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
decode_result = decode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
decode_result = decode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
decode_result = decode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
decode_result = TLV_DECODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
decode_result = TLV_DECODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
}
|
||||
|
||||
if (decode_result < 0) {
|
||||
@@ -284,24 +275,17 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
|
||||
LOG_FUNC_IN;
|
||||
|
||||
int header_result;
|
||||
int encode_result;
|
||||
|
||||
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
|
||||
uint8_t *buffer_log = buffer;
|
||||
int down_link;
|
||||
|
||||
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
|
||||
down_link = 1;
|
||||
# else
|
||||
down_link = 0;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* First encode the EMM message header */
|
||||
header_result = _emm_msg_encode_header(&msg->header, buffer, len);
|
||||
|
||||
@@ -315,144 +299,144 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
len -= header_result;
|
||||
|
||||
switch(msg->header.message_type) {
|
||||
case EMM_INFORMATION:
|
||||
encode_result = encode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
case EMM_INFORMATION:
|
||||
encode_result = encode_emm_information(&msg->emm_information, buffer, len);
|
||||
break;
|
||||
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
case UPLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_uplink_nas_transport(&msg->uplink_nas_transport, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REJECT:
|
||||
encode_result = encode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REJECT:
|
||||
encode_result = encode_authentication_reject(&msg->authentication_reject,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_FAILURE:
|
||||
encode_result = encode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_FAILURE:
|
||||
encode_result = encode_authentication_failure(&msg->authentication_failure,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DETACH_ACCEPT:
|
||||
encode_result = encode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
case DETACH_ACCEPT:
|
||||
encode_result = encode_detach_accept(&msg->detach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REJECT:
|
||||
encode_result = encode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
case SERVICE_REJECT:
|
||||
encode_result = encode_service_reject(&msg->service_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_REQUEST:
|
||||
encode_result = encode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_REQUEST:
|
||||
encode_result = encode_authentication_request(&msg->authentication_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
encode_result = encode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REQUEST:
|
||||
encode_result = encode_tracking_area_update_request(
|
||||
&msg->tracking_area_update_request, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REQUEST:
|
||||
encode_result = encode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
case ATTACH_REQUEST:
|
||||
encode_result = encode_attach_request(&msg->attach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case EMM_STATUS:
|
||||
encode_result = encode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
case EMM_STATUS:
|
||||
encode_result = encode_emm_status(&msg->emm_status, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_RESPONSE:
|
||||
encode_result = encode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
case IDENTITY_RESPONSE:
|
||||
encode_result = encode_identity_response(&msg->identity_response, buffer, len);
|
||||
break;
|
||||
|
||||
case IDENTITY_REQUEST:
|
||||
encode_result = encode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
case IDENTITY_REQUEST:
|
||||
encode_result = encode_identity_request(&msg->identity_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
encode_result = encode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMMAND:
|
||||
encode_result = encode_guti_reallocation_command(&msg->guti_reallocation_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
encode_result = encode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_REJECT:
|
||||
encode_result = encode_tracking_area_update_reject(
|
||||
&msg->tracking_area_update_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_ACCEPT:
|
||||
encode_result = encode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
case ATTACH_ACCEPT:
|
||||
encode_result = encode_attach_accept(&msg->attach_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
encode_result = encode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMPLETE:
|
||||
encode_result = encode_security_mode_complete(&msg->security_mode_complete,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
encode_result = encode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_ACCEPT:
|
||||
encode_result = encode_tracking_area_update_accept(
|
||||
&msg->tracking_area_update_accept, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_REJECT:
|
||||
encode_result = encode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
case ATTACH_REJECT:
|
||||
encode_result = encode_attach_reject(&msg->attach_reject, buffer, len);
|
||||
break;
|
||||
|
||||
case ATTACH_COMPLETE:
|
||||
encode_result = encode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
case ATTACH_COMPLETE:
|
||||
encode_result = encode_attach_complete(&msg->attach_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
encode_result = encode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
case TRACKING_AREA_UPDATE_COMPLETE:
|
||||
encode_result = encode_tracking_area_update_complete(
|
||||
&msg->tracking_area_update_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
encode_result = encode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
case CS_SERVICE_NOTIFICATION:
|
||||
encode_result = encode_cs_service_notification(&msg->cs_service_notification,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_REJECT:
|
||||
encode_result = encode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
case SECURITY_MODE_REJECT:
|
||||
encode_result = encode_security_mode_reject(&msg->security_mode_reject, buffer,
|
||||
len);
|
||||
break;
|
||||
|
||||
case DETACH_REQUEST:
|
||||
encode_result = encode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
case DETACH_REQUEST:
|
||||
encode_result = encode_detach_request(&msg->detach_request, buffer, len);
|
||||
break;
|
||||
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
encode_result = encode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
case GUTI_REALLOCATION_COMPLETE:
|
||||
encode_result = encode_guti_reallocation_complete(
|
||||
&msg->guti_reallocation_complete, buffer, len);
|
||||
break;
|
||||
|
||||
case SECURITY_MODE_COMMAND:
|
||||
encode_result = encode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
case SECURITY_MODE_COMMAND:
|
||||
encode_result = encode_security_mode_command(&msg->security_mode_command,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
case DOWNLINK_NAS_TRANSPORT:
|
||||
encode_result = encode_downlink_nas_transport(&msg->downlink_nas_transport,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
encode_result = encode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
case EXTENDED_SERVICE_REQUEST:
|
||||
encode_result = encode_extended_service_request(&msg->extended_service_request,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
encode_result = encode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
case AUTHENTICATION_RESPONSE:
|
||||
encode_result = encode_authentication_response(&msg->authentication_response,
|
||||
buffer, len);
|
||||
break;
|
||||
|
||||
case SERVICE_REQUEST:
|
||||
encode_result = encode_service_request(&msg->service_request, buffer, len);
|
||||
break;
|
||||
case SERVICE_REQUEST:
|
||||
encode_result = encode_service_request(&msg->service_request, buffer, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
encode_result = TLV_ENCODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
default:
|
||||
LOG_TRACE(ERROR, "EMM-MSG - Unexpected message type: 0x%x",
|
||||
msg->header.message_type);
|
||||
encode_result = TLV_ENCODE_WRONG_MESSAGE_TYPE;
|
||||
/* TODO: Handle not standard layer 3 messages: SERVICE_REQUEST */
|
||||
}
|
||||
|
||||
if (encode_result < 0) {
|
||||
@@ -495,8 +479,7 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len)
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _emm_msg_decode_header(emm_msg_header_t *header,
|
||||
const uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
const uint8_t *buffer, uint32_t len) {
|
||||
int size = 0;
|
||||
|
||||
/* Check the buffer length */
|
||||
@@ -538,8 +521,7 @@ static int _emm_msg_decode_header(emm_msg_header_t *header,
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _emm_msg_encode_header(const emm_msg_header_t *header,
|
||||
uint8_t *buffer, uint32_t len)
|
||||
{
|
||||
uint8_t *buffer, uint32_t len) {
|
||||
int size = 0;
|
||||
|
||||
/* Check the buffer length */
|
||||
@@ -558,7 +540,6 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
|
||||
ENCODE_U8(buffer + size, *(uint8_t *)(header), size);
|
||||
/* Encode the message type */
|
||||
ENCODE_U8(buffer + size, header->message_type, size);
|
||||
|
||||
return (size);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ Description Implements the API used by the NAS layer running in the UE
|
||||
#include "networkDef.h"
|
||||
#include "at_command.h"
|
||||
#include "user_api_defs.h"
|
||||
#include "user_defs.h"
|
||||
#include "../../user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
@@ -58,13 +58,13 @@ Description Implements the API used by the NAS layer running in the UE
|
||||
/****************** E X P O R T E D F U N C T I O N S ******************/
|
||||
/****************************************************************************/
|
||||
|
||||
int user_api_initialize(user_api_id_t *user_api_id, const char* host, const char* port, const char* devname, const char* devparams);
|
||||
int user_api_initialize(user_api_id_t *user_api_id, const char *host, const char *port, const char *devname, const char *devparams);
|
||||
|
||||
int user_api_emm_callback(user_api_id_t *user_api_id, Stat_t stat, tac_t tac, ci_t ci, AcT_t AcT, const char* data, size_t size);
|
||||
int user_api_emm_callback(user_api_id_t *user_api_id, Stat_t stat, tac_t tac, ci_t ci, AcT_t AcT, const char *data, size_t size);
|
||||
int user_api_esm_callback(user_api_id_t *user_api_id, int cid, network_pdn_state_t state);
|
||||
|
||||
int user_api_get_fd(user_api_id_t *user_api_id);
|
||||
const void* user_api_get_data(user_at_commands_t *commands, int index);
|
||||
const void *user_api_get_data(user_at_commands_t *commands, int index);
|
||||
|
||||
int user_api_read_data(user_api_id_t *user_api_id);
|
||||
int user_api_set_data(user_api_id_t *user_api_id, char *message);
|
||||
@@ -72,6 +72,6 @@ int user_api_send_data(user_api_id_t *user_api_id, int length);
|
||||
void user_api_close(user_api_id_t *user_api_id);
|
||||
|
||||
int user_api_decode_data(user_api_id_t *user_api_id, user_at_commands_t *commands, int length);
|
||||
int user_api_encode_data(user_api_id_t *user_api_id, const void* data, int add_success_code);
|
||||
int user_api_encode_data(user_api_id_t *user_api_id, const void *data, int add_success_code);
|
||||
|
||||
#endif /* __USER_API_H__ */
|
||||
|
||||
@@ -41,7 +41,7 @@ Description Defines the EPS Mobility Management procedure call manager,
|
||||
|
||||
#include "commonDef.h"
|
||||
#include "networkDef.h"
|
||||
#include "user_defs.h"
|
||||
#include "../user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
@@ -58,7 +58,7 @@ Description Defines the EPS Mobility Management procedure call manager,
|
||||
* EPS Mobility Management sublayer
|
||||
*/
|
||||
typedef int (*emm_indication_callback_t) (user_api_id_t *user_api_id, Stat_t, tac_t, ci_t, AcT_t,
|
||||
const char*, size_t);
|
||||
const char *, size_t);
|
||||
|
||||
/****************************************************************************/
|
||||
/******************** G L O B A L V A R I A B L E S ********************/
|
||||
|
||||
@@ -45,7 +45,7 @@ Description Defines functions used to handle state of EPS bearer contexts
|
||||
#include "esmData.h"
|
||||
|
||||
#include "nas_timer.h"
|
||||
#include "user_defs.h"
|
||||
#include "../user_defs.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/********************* G L O B A L C O N S T A N T S *******************/
|
||||
|
||||
@@ -48,21 +48,17 @@ Description Defines functions used to handle EPS bearer contexts.
|
||||
|
||||
#include "emm_sap.h"
|
||||
#include "system.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "assertions.h"
|
||||
#endif
|
||||
#include "assertions.h"
|
||||
#include "pdcp.h"
|
||||
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#ifdef UESIM_EXPANSION
|
||||
#include "openairinterface5g_limits.h"
|
||||
extern uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
#endif
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
/****************************************************************************/
|
||||
@@ -107,18 +103,13 @@ static int _esm_ebr_context_check_precedence(const network_tft_t *,
|
||||
int esm_ebr_context_create(
|
||||
esm_data_t *esm_data, int ueid,
|
||||
int pid, int ebi, int is_default,
|
||||
const network_qos_t *qos, const network_tft_t *tft)
|
||||
{
|
||||
const network_qos_t *qos, const network_tft_t *tft) {
|
||||
int bid = 0;
|
||||
esm_data_context_t *esm_ctx = NULL;
|
||||
esm_pdn_t *pdn = NULL;
|
||||
|
||||
LOG_FUNC_IN;
|
||||
|
||||
esm_ctx = esm_data;
|
||||
|
||||
bid = ESM_DATA_EPS_BEARER_MAX;
|
||||
|
||||
LOG_TRACE(INFO, "ESM-PROC - Create new %s EPS bearer context (ebi=%d) "
|
||||
"for PDN connection (pid=%d)",
|
||||
(is_default)? "default" : "dedicated", ebi, pid);
|
||||
@@ -166,7 +157,7 @@ int esm_ebr_context_create(
|
||||
esm_bearer_t *ebr = (esm_bearer_t *)malloc(sizeof(esm_bearer_t));
|
||||
|
||||
if (ebr != NULL) {
|
||||
memset(ebr, 0 , sizeof(esm_bearer_t));
|
||||
memset(ebr, 0, sizeof(esm_bearer_t));
|
||||
/* Increment the total number of active EPS bearers */
|
||||
esm_ctx->n_ebrs += 1;
|
||||
/* Increment the number of EPS bearer for this PDN connection */
|
||||
@@ -207,147 +198,153 @@ int esm_ebr_context_create(
|
||||
|
||||
// LG ADD TEMP
|
||||
{
|
||||
char *tmp = NULL;
|
||||
char ipv4_addr[INET_ADDRSTRLEN];
|
||||
//char ipv6_addr[INET6_ADDRSTRLEN];
|
||||
char *netmask = NULL;
|
||||
char broadcast[INET_ADDRSTRLEN];
|
||||
struct in_addr in_addr;
|
||||
char command_line[500];
|
||||
int res = -1;
|
||||
char *tmp = NULL;
|
||||
char ipv4_addr[INET_ADDRSTRLEN];
|
||||
//char ipv6_addr[INET6_ADDRSTRLEN];
|
||||
char *netmask = NULL;
|
||||
char broadcast[INET_ADDRSTRLEN];
|
||||
struct in_addr in_addr;
|
||||
char command_line[500];
|
||||
int res = -1;
|
||||
|
||||
switch (pdn->type) {
|
||||
case NET_PDN_TYPE_IPV4V6:
|
||||
//ipv6_addr[0] = pdn->ip_addr[4];
|
||||
/* TODO? */
|
||||
switch (pdn->type) {
|
||||
case NET_PDN_TYPE_IPV4V6:
|
||||
|
||||
// etc
|
||||
case NET_PDN_TYPE_IPV4:
|
||||
// in_addr is in network byte order
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( pdn->ip_addr[3] & 0x000000FF);
|
||||
//ipv6_addr[0] = pdn->ip_addr[4];
|
||||
/* TODO? */
|
||||
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
|
||||
tmp = inet_ntoa(in_addr);
|
||||
//AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(ipv4_addr, tmp);
|
||||
|
||||
if (IN_CLASSA(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.0.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((255 << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSB(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSC(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.255.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
// etc
|
||||
case NET_PDN_TYPE_IPV4:
|
||||
// in_addr is in network byte order
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else {
|
||||
netmask = "255.255.255.255";
|
||||
strcpy(broadcast, ipv4_addr);
|
||||
}
|
||||
( pdn->ip_addr[3] & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
//AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(ipv4_addr, tmp);
|
||||
|
||||
if(nfapi_mode ==3){
|
||||
if (IN_CLASSA(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.0.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((255 << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSB(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.0.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((255 << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else if (IN_CLASSC(ntohl(in_addr.s_addr))) {
|
||||
netmask = "255.255.255.0";
|
||||
in_addr.s_addr = pdn->ip_addr[0] << 24 |
|
||||
((pdn->ip_addr[1] << 16) & 0x00FF0000) |
|
||||
((pdn->ip_addr[2] << 8) & 0x0000FF00) |
|
||||
( 255 & 0x000000FF);
|
||||
in_addr.s_addr = htonl(in_addr.s_addr);
|
||||
tmp = inet_ntoa(in_addr);
|
||||
// AssertFatal(tmp ,
|
||||
// "error in PDN IPv4 address %x",
|
||||
// in_addr.s_addr);
|
||||
strcpy(broadcast, tmp);
|
||||
} else {
|
||||
netmask = "255.255.255.255";
|
||||
strcpy(broadcast, ipv4_addr);
|
||||
}
|
||||
|
||||
if(nfapi_mode ==3) {
|
||||
// this is for L2 FAPI simulator.
|
||||
// change for multiple UE's like 256UEs.
|
||||
// if it's made too many tables , OS may crush so we use one table.
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
if(PDCP_USE_NETLINK) {
|
||||
#ifdef UESIM_EXPANSION
|
||||
uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
|
||||
res = sprintf(command_line,
|
||||
"ifconfig oip%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/24 table %d && "
|
||||
"ip rule add to %s/24 table %d && "
|
||||
"ip route add default dev oip%d table %d",
|
||||
inst_nic + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, 201,
|
||||
ipv4_addr, 201,
|
||||
inst_nic + 1, 201);
|
||||
|
||||
inst_pdcp_list[inst_nic] = ueid;
|
||||
uint16_t inst_nic = (pdn->ip_addr[3] & 0x000000FF) - 2;
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/24 table %d && "
|
||||
"ip rule add to %s/24 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, 201,
|
||||
ipv4_addr, 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
inst_nic + 1, 201);
|
||||
inst_pdcp_list[inst_nic] = ueid;
|
||||
#else
|
||||
res = sprintf(command_line,
|
||||
"ifconfig oip%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev oip%d table %d",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
ueid + 1, ueid + 201);
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
res = sprintf(command_line,
|
||||
"ifconfig oip%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev oip%d table %d",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
ueid + 1, ueid + 201);
|
||||
}
|
||||
if ( res<0 ) {
|
||||
} // PDCP_USE_NETLINK
|
||||
} else {
|
||||
res = sprintf(command_line,
|
||||
"ifconfig %s%d %s netmask %s broadcast %s up && "
|
||||
"ip rule add from %s/32 table %d && "
|
||||
"ip rule add to %s/32 table %d && "
|
||||
"ip route add default dev %s%d table %d",
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ipv4_addr, netmask, broadcast,
|
||||
ipv4_addr, ueid + 201,
|
||||
ipv4_addr, ueid + 201,
|
||||
UE_NAS_USE_TUN?"oaitun_ue":"oip",
|
||||
ueid + 1, ueid + 201);
|
||||
}
|
||||
|
||||
if ( res<0 ) {
|
||||
LOG_TRACE(WARNING, "ESM-PROC - Failed to system command string");
|
||||
}
|
||||
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
|
||||
command_line);
|
||||
}
|
||||
|
||||
/* Calling system() here disrupts UE's realtime processing in some cases.
|
||||
* This may be because of the call to fork(), which, for some
|
||||
* unidentified reason, interacts badly with other (realtime) threads.
|
||||
* background_system() is a replacement mechanism relying on a
|
||||
* background process that does the system() and reports result to
|
||||
* the parent process (lte-softmodem, oaisim, ...). The background
|
||||
* process is created very early in the life of the parent process.
|
||||
* The processes interact through standard pipes. See
|
||||
* common/utils/system.c for details.
|
||||
*/
|
||||
if (background_system(command_line) != 0)
|
||||
LOG_TRACE(ERROR, "ESM-PROC - failed command '%s'", command_line);
|
||||
LOG_TRACE(INFO, "ESM-PROC - executing %s ",
|
||||
command_line);
|
||||
|
||||
break;
|
||||
/* Calling system() here disrupts UE's realtime processing in some cases.
|
||||
* This may be because of the call to fork(), which, for some
|
||||
* unidentified reason, interacts badly with other (realtime) threads.
|
||||
* background_system() is a replacement mechanism relying on a
|
||||
* background process that does the system() and reports result to
|
||||
* the parent process (lte-softmodem, oaisim, ...). The background
|
||||
* process is created very early in the life of the parent process.
|
||||
* The processes interact through standard pipes. See
|
||||
* common/utils/system.c for details.
|
||||
*/
|
||||
if (background_system(command_line) != 0)
|
||||
LOG_TRACE(ERROR, "ESM-PROC - failed command '%s'", command_line);
|
||||
|
||||
case NET_PDN_TYPE_IPV6:
|
||||
break;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// AssertFatal(0, "Forced stop in NAS UE");
|
||||
case NET_PDN_TYPE_IPV6:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// AssertFatal(0, "Forced stop in NAS UE");
|
||||
}
|
||||
|
||||
/* Return the EPS bearer identity of the default EPS bearer
|
||||
@@ -382,16 +379,13 @@ int esm_ebr_context_create(
|
||||
** **
|
||||
***************************************************************************/
|
||||
int esm_ebr_context_release(nas_user_t *user,
|
||||
int ebi, int *pid, int *bid)
|
||||
{
|
||||
int ebi, int *pid, int *bid) {
|
||||
int found = FALSE;
|
||||
esm_pdn_t *pdn = NULL;
|
||||
esm_data_context_t *esm_ctx;
|
||||
esm_ebr_data_t *esm_ebr_data = user->esm_ebr_data;
|
||||
user_api_id_t *user_api_id = user->user_api_id;
|
||||
|
||||
LOG_FUNC_IN;
|
||||
|
||||
esm_ctx = user->esm_data;
|
||||
|
||||
if (ebi != ESM_EBI_UNASSIGNED) {
|
||||
@@ -496,7 +490,6 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
*/
|
||||
for (i = 1; pdn->n_bearers > 0; i++) {
|
||||
if (pdn->bearer[i]) {
|
||||
|
||||
LOG_TRACE(WARNING, "ESM-PROC - Release EPS bearer context "
|
||||
"(ebi=%d)", pdn->bearer[i]->ebi);
|
||||
|
||||
@@ -507,11 +500,9 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
|
||||
/* Set the EPS bearer context state to INACTIVE */
|
||||
esm_ebr_set_status(user_api_id, esm_ebr_data, pdn->bearer[i]->ebi,
|
||||
ESM_EBR_INACTIVE, TRUE);
|
||||
|
||||
ESM_EBR_INACTIVE, TRUE);
|
||||
/* Release EPS bearer data */
|
||||
esm_ebr_release(esm_ebr_data, pdn->bearer[i]->ebi);
|
||||
|
||||
// esm_ebr_release()
|
||||
/* Release dedicated EPS bearer data */
|
||||
free(pdn->bearer[i]);
|
||||
@@ -533,7 +524,6 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 3GPP TS 24.301, section 6.4.4.6
|
||||
* If the UE locally deactivated all EPS bearer contexts, the UE
|
||||
* shall perform a local detach and enter state EMM-DEREGISTERED.
|
||||
@@ -582,10 +572,8 @@ int esm_ebr_context_release(nas_user_t *user,
|
||||
** Others: None **
|
||||
** **
|
||||
***************************************************************************/
|
||||
int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi)
|
||||
{
|
||||
int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi) {
|
||||
LOG_FUNC_IN;
|
||||
|
||||
int pid;
|
||||
|
||||
for (pid = 0; pid < ESM_DATA_PDN_MAX; pid++) {
|
||||
@@ -633,10 +621,8 @@ int esm_ebr_context_get_pid(esm_data_t *esm_data, int ebi)
|
||||
***************************************************************************/
|
||||
int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi,
|
||||
const network_tft_t *tft,
|
||||
esm_ebr_context_tft_t operation)
|
||||
{
|
||||
esm_ebr_context_tft_t operation) {
|
||||
LOG_FUNC_IN;
|
||||
|
||||
int rc = RETURNerror;
|
||||
int i;
|
||||
|
||||
@@ -702,8 +688,7 @@ int esm_ebr_context_check_tft(esm_data_t *esm_data, int pid, int ebi,
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
|
||||
const network_tft_t *tft2)
|
||||
{
|
||||
const network_tft_t *tft2) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
@@ -744,8 +729,7 @@ static int _esm_ebr_context_check_identifiers(const network_tft_t *tft1,
|
||||
** **
|
||||
***************************************************************************/
|
||||
static int _esm_ebr_context_check_precedence(const network_tft_t *tft1,
|
||||
const network_tft_t *tft2)
|
||||
{
|
||||
const network_tft_t *tft2) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
|
||||
# define TASK_ORIGIN TASK_NAS_UE
|
||||
|
||||
|
||||
#if (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) )
|
||||
static const uint8_t emm_message_ids[] = {
|
||||
__attribute__ ((unused)) static const uint8_t emm_message_ids[] = {
|
||||
ATTACH_REQUEST,
|
||||
ATTACH_ACCEPT,
|
||||
ATTACH_COMPLETE,
|
||||
@@ -60,7 +61,7 @@ static const uint8_t emm_message_ids[] = {
|
||||
CS_SERVICE_NOTIFICATION,
|
||||
};
|
||||
|
||||
static const uint8_t esm_message_ids[] = {
|
||||
__attribute__ ((unused)) static const uint8_t esm_message_ids[] = {
|
||||
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
|
||||
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
|
||||
ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# include "create_tasks.h"
|
||||
# include "common/utils/LOG/log.h"
|
||||
@@ -27,21 +26,11 @@
|
||||
# include "common/ran_context.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "x2ap_eNB.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
/* temporary warning removale while implementing noS1 */
|
||||
/* as config option */
|
||||
#else
|
||||
#ifdef EPC_MODE_ENABLED
|
||||
#undef EPC_MODE_ENABLED
|
||||
#endif
|
||||
#define EPC_MODE_ENABLED 0
|
||||
#endif
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -58,32 +47,20 @@ int create_tasks(uint32_t enb_nb) {
|
||||
LOG_D(ENB_APP, "%s(enb_nb:%d\n", __FUNCTION__, enb_nb);
|
||||
ngran_node_t type = RC.rrc[0]->node_type;
|
||||
int rc;
|
||||
itti_wait_ready(1);
|
||||
|
||||
if (enb_nb > 0) {
|
||||
LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
|
||||
if (itti_create_task (TASK_ENB_APP, eNB_app_task, NULL) < 0) {
|
||||
LOG_E(ENB_APP, "Create task for eNB APP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(RRC,"Creating RRC eNB Task\n");
|
||||
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
|
||||
LOG_E(RRC, "Create task for RRC eNB failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (enb_nb == 0) return 0;
|
||||
|
||||
if (EPC_MODE_ENABLED && enb_nb > 0) {
|
||||
/* this task needs not be started if:
|
||||
* * there is no CU/DU split
|
||||
* * ENABLE_USE_MME is not defined
|
||||
* Since we cannot express this condition on both configuration and
|
||||
* compilation defines, we always start this task.
|
||||
*/
|
||||
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(ENB_APP, "Creating ENB_APP eNB Task\n");
|
||||
rc = itti_create_task (TASK_ENB_APP, eNB_app_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for eNB APP failed\n");
|
||||
|
||||
LOG_I(RRC,"Creating RRC eNB Task\n");
|
||||
rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for RRC eNB failed\n");
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for SCTP failed\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -91,16 +68,13 @@ int create_tasks(uint32_t enb_nb) {
|
||||
case ngran_eNB_CU:
|
||||
case ngran_ng_eNB_CU:
|
||||
case ngran_gNB_CU:
|
||||
if (enb_nb > 0) {
|
||||
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
|
||||
}
|
||||
rc = itti_create_task(TASK_CU_F1, F1AP_CU_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for CU F1AP failed\n");
|
||||
/* fall through */
|
||||
case ngran_eNB:
|
||||
case ngran_ng_eNB:
|
||||
case ngran_gNB:
|
||||
#if defined(ENABLE_USE_MME)
|
||||
if (EPC_MODE_ENABLED && enb_nb > 0) {
|
||||
if (EPC_MODE_ENABLED) {
|
||||
rc = itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for S1AP failed\n");
|
||||
if (!(get_softmodem_params()->emulate_rf)){
|
||||
@@ -112,19 +86,16 @@ int create_tasks(uint32_t enb_nb) {
|
||||
rc = itti_create_task(TASK_X2AP, x2ap_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for X2AP failed\n");
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
/* intentionally left blank */
|
||||
break;
|
||||
}
|
||||
|
||||
if ((type == ngran_eNB_DU || type == ngran_gNB_DU) && (enb_nb > 0)) {
|
||||
if (type == ngran_eNB_DU || type == ngran_gNB_DU) {
|
||||
rc = itti_create_task(TASK_DU_F1, F1AP_DU_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for DU F1AP failed\n");
|
||||
}
|
||||
|
||||
itti_wait_ready(0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,19 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
# include "create_tasks.h"
|
||||
# include "common/utils/LOG/log.h"
|
||||
|
||||
#ifdef OPENAIR2
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#endif
|
||||
#include "sctp_eNB_task.h"
|
||||
#include "s1ap_eNB.h"
|
||||
#include "openair3/NAS/UE/nas_ue_task.h"
|
||||
#include "udp_eNB_task.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#if ENABLE_RAL
|
||||
#include "lteRALue.h"
|
||||
#include "lteRALenb.h"
|
||||
@@ -43,24 +40,25 @@
|
||||
int create_tasks_ue(uint32_t ue_nb) {
|
||||
LOG_D(ENB_APP, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
|
||||
itti_wait_ready(1);
|
||||
# if defined(ENABLE_USE_MME)
|
||||
|
||||
if (EPC_MODE_ENABLED) {
|
||||
# if defined(NAS_BUILT_IN_UE)
|
||||
|
||||
if (ue_nb > 0) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
if (ue_nb > 0) {
|
||||
nas_user_container_t *users = calloc(1, sizeof(*users));
|
||||
|
||||
if (users == NULL) abort();
|
||||
if (users == NULL) abort();
|
||||
|
||||
users->count = ue_nb;
|
||||
users->count = ue_nb;
|
||||
|
||||
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
if (itti_create_task (TASK_NAS_UE, nas_ue_task, users) < 0) {
|
||||
LOG_E(NAS, "Create task for NAS UE failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
# endif
|
||||
} /* EPC_MODE_ENABLED */
|
||||
|
||||
if (ue_nb > 0) {
|
||||
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
|
||||
@@ -72,4 +70,4 @@ int create_tasks_ue(uint32_t ue_nb) {
|
||||
itti_wait_ready(0);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ ifeq ($(OPENSSL_FOUND), 0)
|
||||
@(warning "openssl library is not installed on your system, openssl lib needed, continuing with security disabled")
|
||||
SECU=0
|
||||
else
|
||||
CFLAGS += -DENABLE_SECURITY
|
||||
LIBS += $(OPENSSL_LIBS) $(NETTLE_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
+67
-106
@@ -80,14 +80,8 @@
|
||||
#include "UTIL/OTG/otg_extern.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include "s1ap_eNB.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "T.h"
|
||||
|
||||
@@ -104,11 +98,6 @@ struct timing_info_t {
|
||||
// Fix per CC openair rf/if device update
|
||||
// extern openair0_device openair0;
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
extern volatile int start_eNB;
|
||||
extern volatile int start_UE;
|
||||
#endif
|
||||
extern volatile int oai_exit;
|
||||
|
||||
extern int transmission_mode;
|
||||
@@ -161,16 +150,16 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name) {
|
||||
start_meas(&softmodem_stats_rxtx_sf);
|
||||
//L1_rxtx_proc_t *L1_proc_tx = &eNB->proc.L1_proc_tx;
|
||||
|
||||
// *******************************************************************
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
RU_t *ru = RC.ru[0];
|
||||
RU_t *ru = RC.ru[0];
|
||||
#endif
|
||||
|
||||
if (eNB ==NULL) {
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
LOG_D(PHY,"%s:%d: rxtx invalid argument, eNB pointer is NULL",__FILE__,__LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (nfapi_mode == 1) {
|
||||
// I am a PNF and I need to let nFAPI know that we have a (sub)frame tick
|
||||
uint16_t frame = proc->frame_rx;
|
||||
@@ -224,42 +213,41 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER, 1 );
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
if (nfapi_mode == 2){
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
if (nfapi_mode == 2) {
|
||||
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
|
||||
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
|
||||
// L2-emulator can work only one eNB.
|
||||
// memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
// memcpy(&pre_scd_activeUE, &RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[0]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
|
||||
memcpy(&pre_scd_activeUE, &RC.mac[0]->UE_list.active, sizeof(boolean_t)*NUMBER_OF_UE_MAX);
|
||||
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
}else{
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
if (pthread_mutex_lock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error locking proc mutex for eNB pre scd\n");
|
||||
exit_fun("error locking mutex_time");
|
||||
}
|
||||
#endif
|
||||
|
||||
ru->proc.instance_pre_scd++;
|
||||
|
||||
if (ru->proc.instance_pre_scd == 0) {
|
||||
if (pthread_cond_signal(&ru->proc.cond_pre_scd) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB pre scd\n" );
|
||||
exit_fun( "ERROR pthread_cond_signal cond_pre_scd" );
|
||||
}
|
||||
} else {
|
||||
LOG_E( PHY, "[eNB] frame %d subframe %d rxtx busy instance_pre_scd %d\n",
|
||||
proc->frame_rx,proc->subframe_rx,ru->proc.instance_pre_scd );
|
||||
}
|
||||
|
||||
if (pthread_mutex_unlock(&ru->proc.mutex_pre_scd)!= 0) {
|
||||
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
|
||||
exit_fun("error unlocking mutex_pre_scd");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
eNB->UL_INFO.frame = proc->frame_rx;
|
||||
eNB->UL_INFO.subframe = proc->subframe_rx;
|
||||
@@ -324,9 +312,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, char *thread_name
|
||||
}
|
||||
|
||||
|
||||
static void* L1_thread_tx(void* param) {
|
||||
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
static void *L1_thread_tx(void *param) {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
L1_rxtx_proc_t *proc = &eNB_proc->L1_proc_tx;
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
char thread_name[100];
|
||||
@@ -337,6 +324,7 @@ static void* L1_thread_tx(void* param) {
|
||||
|
||||
while (!oai_exit) {
|
||||
if (wait_on_condition(&proc->mutex,&proc->cond,&proc->instance_cnt,thread_name)<0) break;
|
||||
|
||||
if (oai_exit) break;
|
||||
|
||||
// *****************************************
|
||||
@@ -349,8 +337,6 @@ static void* L1_thread_tx(void* param) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
|
||||
pthread_mutex_lock( &proc->mutex );
|
||||
proc->instance_cnt = -1;
|
||||
|
||||
@@ -359,6 +345,7 @@ static void* L1_thread_tx(void* param) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
}
|
||||
|
||||
pthread_mutex_unlock( &proc->mutex );
|
||||
wakeup_txfh(proc,eNB);
|
||||
}
|
||||
@@ -372,29 +359,25 @@ static void* L1_thread_tx(void* param) {
|
||||
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
|
||||
*/
|
||||
|
||||
static void* L1_thread( void* param ) {
|
||||
|
||||
static void *L1_thread( void *param ) {
|
||||
static int eNB_thread_rxtx_status;
|
||||
//L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
L1_rxtx_proc_t *proc;
|
||||
|
||||
// Working
|
||||
if(nfapi_mode ==2){
|
||||
proc = (L1_rxtx_proc_t*)param;
|
||||
}
|
||||
else{
|
||||
L1_proc_t *eNB_proc = (L1_proc_t*)param;
|
||||
if(nfapi_mode ==2) {
|
||||
proc = (L1_rxtx_proc_t *)param;
|
||||
} else {
|
||||
L1_proc_t *eNB_proc = (L1_proc_t *)param;
|
||||
proc = &eNB_proc->L1_proc;
|
||||
}
|
||||
|
||||
PHY_VARS_eNB *eNB = RC.eNB[0][proc->CC_id];
|
||||
|
||||
char thread_name[100];
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
// set default return value
|
||||
eNB_thread_rxtx_status = 0;
|
||||
|
||||
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.L1_proc == proc ? 0 : 1);
|
||||
thread_top_init(thread_name,1,470000,500000,500000);
|
||||
pthread_setname_np( pthread_self(),"rxtx processing");
|
||||
@@ -420,8 +403,10 @@ static void* L1_thread( void* param ) {
|
||||
}
|
||||
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
|
||||
if (release_thread(&proc->mutex,&proc->instance_cnt,thread_name)<0) break;
|
||||
if (nfapi_mode!=2){
|
||||
|
||||
if (nfapi_mode!=2) {
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT) wakeup_txfh(proc,eNB);
|
||||
}
|
||||
@@ -433,8 +418,7 @@ static void* L1_thread( void* param ) {
|
||||
return &eNB_thread_rxtx_status;
|
||||
}
|
||||
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru)
|
||||
{
|
||||
void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t *ru) {
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
@@ -444,7 +428,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
|
||||
if (!oai_exit) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
|
||||
|
||||
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
|
||||
L1_proc->frame_rx = ru_proc->frame_rx;
|
||||
L1_proc->subframe_rx = ru_proc->subframe_rx;
|
||||
@@ -452,6 +435,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
L1_proc->subframe_tx = (L1_proc->subframe_rx + sf_ahead)%10;
|
||||
|
||||
if (rxtx(eNB,L1_proc,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
|
||||
ru_proc->timestamp_tx = L1_proc->timestamp_tx;
|
||||
ru_proc->subframe_tx = L1_proc->subframe_tx;
|
||||
ru_proc->frame_tx = L1_proc->frame_tx;
|
||||
@@ -459,11 +443,8 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
|
||||
}
|
||||
|
||||
int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
|
||||
RU_t *ru;
|
||||
RU_proc_t *ru_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
@@ -472,19 +453,22 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH not ready\n", proc->frame_tx, proc->subframe_tx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&eNB->proc.mutex_RU_tx);
|
||||
eNB->proc.RU_mask_tx = 0;
|
||||
pthread_mutex_unlock(&eNB->proc.mutex_RU_tx);
|
||||
|
||||
if (release_thread(&proc->mutex_RUs,&proc->instance_cnt_RUs,"wakeup_txfh")<0) return(-1);
|
||||
|
||||
for(int i=0; i<eNB->num_RU; i++)
|
||||
{
|
||||
for(int i=0; i<eNB->num_RU; i++) {
|
||||
ru = eNB->RU_list[i];
|
||||
ru_proc = &ru->proc;
|
||||
|
||||
if (ru_proc->instance_cnt_eNBs == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX FH thread busy, dropping Frame %d, subframe %d\n", ru_proc->frame_tx, ru_proc->subframe_tx, proc->frame_rx, proc->subframe_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (pthread_mutex_timedlock(&ru_proc->mutex_eNBs,&wait) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB TX1 thread %d (IC %d)\n", ru_proc->subframe_rx&1,ru_proc->instance_cnt_eNBs );
|
||||
exit_fun( "error locking mutex_eNB" );
|
||||
@@ -496,14 +480,13 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
ru_proc->subframe_tx = proc->subframe_tx;
|
||||
ru_proc->frame_tx = proc->frame_tx;
|
||||
|
||||
|
||||
// the thread can now be woken up
|
||||
if (pthread_cond_signal(&ru_proc->cond_eNBs) != 0) {
|
||||
LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB TXnp4 thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &ru_proc->mutex_eNBs );
|
||||
}
|
||||
|
||||
@@ -511,30 +494,24 @@ int wakeup_txfh(L1_rxtx_proc_t *proc,PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
|
||||
int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_rxtx_proc_t *L1_proc = &proc->L1_proc;
|
||||
|
||||
|
||||
struct timespec wait;
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
|
||||
if (pthread_mutex_timedlock(&L1_proc_tx->mutex,&wait) != 0) {
|
||||
LOG_E(PHY, "[SCHED][eNB] ERROR locking mutex for eNB L1_thread_tx\n");
|
||||
exit_fun("ERROR pthread_lock");
|
||||
return(-1);
|
||||
}
|
||||
while(L1_proc_tx->instance_cnt == 0){
|
||||
|
||||
while(L1_proc_tx->instance_cnt == 0) {
|
||||
pthread_cond_wait(&L1_proc_tx->cond,&L1_proc_tx->mutex);
|
||||
}
|
||||
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
|
||||
|
||||
L1_proc_tx->subframe_rx = L1_proc->subframe_rx;
|
||||
L1_proc_tx->frame_rx = L1_proc->frame_rx;
|
||||
L1_proc_tx->subframe_tx = L1_proc->subframe_tx;
|
||||
@@ -547,18 +524,15 @@ int wakeup_tx(PHY_VARS_eNB *eNB) {
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_unlock( &L1_proc_tx->mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
|
||||
L1_proc_t *proc=&eNB->proc;
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
|
||||
L1_rxtx_proc_t *L1_proc=&proc->L1_proc;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
int i;
|
||||
struct timespec wait;
|
||||
@@ -586,7 +560,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
|
||||
if (L1_proc->instance_cnt == 0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: RXTX0 thread busy, dropping\n",L1_proc->frame_rx,L1_proc->subframe_rx);
|
||||
return(-1);
|
||||
@@ -601,9 +574,8 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// We have just received and processed the common part of a subframe, say n.
|
||||
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
|
||||
// transmitted timestamp of the next TX slot (first).
|
||||
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
|
||||
// we want to generate subframe (n+sf_ahead), so TS_tx = TX_rx+sf_ahead*samples_per_tti,
|
||||
@@ -626,7 +598,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
|
||||
}
|
||||
|
||||
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -689,7 +660,6 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
int i;
|
||||
@@ -761,7 +731,6 @@ static void *eNB_thread_prach( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach",1,500000,1000000,20000000);
|
||||
@@ -798,7 +767,6 @@ static void *eNB_thread_prach_br( void *param ) {
|
||||
static int eNB_thread_prach_status;
|
||||
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
|
||||
L1_proc_t *proc = &eNB->proc;
|
||||
|
||||
// set default return value
|
||||
eNB_thread_prach_status = 0;
|
||||
thread_top_init("eNB_thread_prach_br",1,500000,1000000,20000000);
|
||||
@@ -879,7 +847,6 @@ void init_eNB_proc(int inst) {
|
||||
LOG_I(PHY,"Initializing eNB processes instance:%d CC_id %d \n",inst,CC_id);
|
||||
#endif
|
||||
proc = &eNB->proc;
|
||||
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
L1_proc->instance_cnt = -1;
|
||||
@@ -889,14 +856,12 @@ void init_eNB_proc(int inst) {
|
||||
proc->instance_cnt_prach = -1;
|
||||
proc->instance_cnt_asynch_rxtx = -1;
|
||||
proc->instance_cnt_synch = -1;
|
||||
proc->CC_id = CC_id;
|
||||
|
||||
proc->CC_id = CC_id;
|
||||
proc->first_rx =1;
|
||||
proc->first_tx =1;
|
||||
proc->RU_mask_tx = (1<<eNB->num_RU)-1;
|
||||
proc->RU_mask =0;
|
||||
proc->RU_mask_prach =0;
|
||||
|
||||
pthread_mutex_init( &eNB->UL_INFO_mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc->mutex, NULL);
|
||||
pthread_mutex_init( &L1_proc_tx->mutex, NULL);
|
||||
@@ -906,7 +871,6 @@ void init_eNB_proc(int inst) {
|
||||
pthread_mutex_init( &L1_proc_tx->mutex_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc->cond_RUs, NULL);
|
||||
pthread_cond_init( &L1_proc_tx->cond_RUs, NULL);
|
||||
|
||||
pthread_mutex_init( &proc->mutex_prach, NULL);
|
||||
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
|
||||
pthread_mutex_init( &proc->mutex_RU,NULL);
|
||||
@@ -959,7 +923,6 @@ void init_eNB_proc(int inst) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
if (opp_enabled == 1) pthread_create(&proc->process_stats_thread,NULL,process_stats_thread,(void *)eNB);
|
||||
@@ -1000,7 +963,6 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
eNB=RC.eNB[inst][CC_id];
|
||||
|
||||
proc = &eNB->proc;
|
||||
L1_proc = &proc->L1_proc;
|
||||
L1_proc_tx = &proc->L1_proc_tx;
|
||||
@@ -1017,7 +979,6 @@ void kill_eNB_proc(int inst) {
|
||||
L1_proc->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc->cond);
|
||||
pthread_mutex_unlock(&L1_proc->mutex);
|
||||
|
||||
pthread_mutex_lock(&L1_proc_tx->mutex);
|
||||
L1_proc_tx->instance_cnt = 0;
|
||||
pthread_cond_signal(&L1_proc_tx->cond);
|
||||
@@ -1047,10 +1008,11 @@ void kill_eNB_proc(int inst) {
|
||||
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||
LOG_I(PHY, "Joining L1_proc mutex/cond\n");
|
||||
pthread_join( L1_proc->pthread, (void**)&status );
|
||||
pthread_join( L1_proc->pthread, (void **)&status );
|
||||
LOG_I(PHY, "Joining L1_proc_tx mutex/cond\n");
|
||||
pthread_join( L1_proc_tx->pthread, (void**)&status );
|
||||
pthread_join( L1_proc_tx->pthread, (void **)&status );
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Destroying L1_proc mutex/cond\n");
|
||||
pthread_mutex_destroy( &L1_proc->mutex );
|
||||
pthread_cond_destroy( &L1_proc->cond );
|
||||
@@ -1061,7 +1023,6 @@ void kill_eNB_proc(int inst) {
|
||||
pthread_cond_destroy( &L1_proc_tx->cond );
|
||||
pthread_mutex_destroy( &L1_proc_tx->mutex_RUs );
|
||||
pthread_cond_destroy( &L1_proc_tx->cond_RUs );
|
||||
|
||||
pthread_attr_destroy(&proc->attr_prach);
|
||||
pthread_attr_destroy(&proc->attr_asynch_rxtx);
|
||||
pthread_attr_destroy(&L1_proc->attr);
|
||||
|
||||
+1042
-1196
File diff suppressed because it is too large
Load Diff
@@ -94,3 +94,13 @@ void get_common_options(void) {
|
||||
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
}
|
||||
|
||||
unsigned int is_nos1exec(char *exepath) {
|
||||
if ( strcmp( basename(exepath), "lte-softmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
if ( strcmp( basename(exepath), "lte-uesoftmodem-nos1") == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "UTIL/OTG/otg_vars.h"
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#include "create_tasks.h"
|
||||
#endif
|
||||
|
||||
#include "create_tasks.h"
|
||||
|
||||
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
@@ -107,9 +107,6 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
static pthread_t forms_thread; //xforms
|
||||
#endif //XFORMS
|
||||
|
||||
#ifndef ENABLE_USE_MME
|
||||
#define EPC_MODE_ENABLED 0
|
||||
#endif
|
||||
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
@@ -482,7 +479,7 @@ void wait_eNBs(void) {
|
||||
printf("eNB L1 are configured\n");
|
||||
}
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
/*
|
||||
* helper function to terminate a certain ITTI task
|
||||
*/
|
||||
@@ -578,7 +575,7 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void wait_nfapi_init(char *thread_name) {
|
||||
printf( "waiting for NFAPI PNF connection and population of global structure (%s)\n",thread_name);
|
||||
@@ -612,6 +609,11 @@ int main( int argc, char **argv ) {
|
||||
printf("Reading in command-line options\n");
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
|
||||
fprintf(stderr,"Getting configuration failed\n");
|
||||
exit(-1);
|
||||
@@ -629,8 +631,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
#if defined(ENABLE_ITTI)
|
||||
printf("ITTI init, useMME: %i\n" ,EPC_MODE_ENABLED);
|
||||
printf("ITTI init, useMME: %i\n",EPC_MODE_ENABLED);
|
||||
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
|
||||
|
||||
// initialize mscgen log after ITTI
|
||||
@@ -639,15 +640,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
#endif
|
||||
init_opt();
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
printf("PDCP netlink\n");
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
// to make a graceful exit when ctrl-c is pressed
|
||||
signal(SIGSEGV, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
@@ -660,48 +653,6 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
|
||||
printf("Runtime table\n");
|
||||
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
printf("NO deadline scheduler\n");
|
||||
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
|
||||
cpu_set_t cpuset;
|
||||
int s;
|
||||
char cpu_affinity[1024];
|
||||
CPU_ZERO(&cpuset);
|
||||
#ifdef CPU_AFFINITY
|
||||
|
||||
if (get_nprocs() > 2) {
|
||||
CPU_SET(0, &cpuset);
|
||||
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
if (s != 0) {
|
||||
perror( "pthread_setaffinity_np");
|
||||
exit_fun("Error setting processor affinity");
|
||||
}
|
||||
|
||||
LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Check the actual affinity mask assigned to the thread */
|
||||
s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
|
||||
|
||||
if (s != 0) {
|
||||
perror( "pthread_getaffinity_np");
|
||||
exit_fun("Error getting processor affinity ");
|
||||
}
|
||||
|
||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||
|
||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||
if (CPU_ISSET(j, &cpuset)) {
|
||||
char temp[1024];
|
||||
sprintf(temp, " CPU_%d ", j);
|
||||
strcat(cpu_affinity, temp);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||
#endif
|
||||
|
||||
/* Read configuration */
|
||||
if (RC.nb_inst > 0)
|
||||
@@ -712,7 +663,9 @@ int main( int argc, char **argv ) {
|
||||
for (i = 0; i < RC.nb_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
}
|
||||
|
||||
|
||||
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
|
||||
|
||||
if (RC.nb_inst > 0) {
|
||||
|
||||
if (create_tasks(1) < 0) {
|
||||
@@ -722,6 +675,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++) {
|
||||
MessageDef *msg_p = itti_alloc_new_message (TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
|
||||
itti_send_msg_to_task (TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
}
|
||||
}
|
||||
@@ -788,7 +742,7 @@ int main( int argc, char **argv ) {
|
||||
rt_sleep_ns(10*100000000ULL);
|
||||
|
||||
if (nfapi_mode) {
|
||||
printf("NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
||||
LOG_I(ENB_APP,"NFAPI*** - mutex and cond created - will block shortly for completion of PNF connection\n");
|
||||
pthread_cond_init(&sync_cond,NULL);
|
||||
pthread_mutex_init(&sync_mutex, NULL);
|
||||
}
|
||||
@@ -812,8 +766,8 @@ int main( int argc, char **argv ) {
|
||||
nfapi_mode_str = "<UNKNOWN NFAPI MODE>";
|
||||
break;
|
||||
}
|
||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
LOG_I(ENB_APP,"NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
if (nfapi_mode==2) {// VNF
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
@@ -822,8 +776,7 @@ int main( int argc, char **argv ) {
|
||||
wait_nfapi_init("main?");
|
||||
}
|
||||
|
||||
|
||||
printf("START MAIN THREADS\n");
|
||||
LOG_I(ENB_APP,"START MAIN THREADS\n");
|
||||
// start the main threads
|
||||
number_of_cards = 1;
|
||||
printf("RC.nb_L1_inst:%d\n", RC.nb_L1_inst);
|
||||
@@ -837,7 +790,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("wait_eNBs()\n");
|
||||
wait_eNBs();
|
||||
|
||||
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
@@ -846,7 +798,8 @@ int main( int argc, char **argv ) {
|
||||
if (RC.nb_RU >0 && nfapi_mode != 2) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file);
|
||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
||||
|
||||
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
@@ -862,22 +815,21 @@ int main( int argc, char **argv ) {
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
wait_RUs();
|
||||
printf("ALL RUs READY!\n");
|
||||
printf("RC.nb_RU:%d\n", RC.nb_RU);
|
||||
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init eNBs\n");
|
||||
|
||||
if (nfapi_mode != 1 && nfapi_mode != 2) {
|
||||
printf("Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
init_eNB_afterRU();
|
||||
} else {
|
||||
printf("NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
||||
LOG_I(ENB_APP,"NFAPI mode - DO NOT call init_eNB_afterRU()\n");
|
||||
}
|
||||
|
||||
printf("ALL RUs ready - ALL eNBs ready\n");
|
||||
LOG_UI(ENB_APP,"ALL RUs ready - ALL eNBs ready\n");
|
||||
// connect the TX/RX buffers
|
||||
sleep(1); /* wait for thread activation */
|
||||
printf("Sending sync to all threads\n");
|
||||
LOG_I(ENB_APP,"Sending sync to all threads\n");
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
sync_var=0;
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
@@ -886,21 +838,11 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
// wait for end of program
|
||||
printf("TYPE <CTRL-C> TO TERMINATE\n");
|
||||
LOG_UI(ENB_APP,"TYPE <CTRL-C> TO TERMINATE\n");
|
||||
//getchar();
|
||||
#if defined(ENABLE_ITTI)
|
||||
printf("Entering ITTI signals handler\n");
|
||||
itti_wait_tasks_end();
|
||||
printf("Returned from ITTI signal handler\n");
|
||||
oai_exit=1;
|
||||
printf("oai_exit=%d\n",oai_exit);
|
||||
#else
|
||||
|
||||
while (oai_exit==0)
|
||||
rt_sleep_ns(100000000ULL);
|
||||
|
||||
printf("Terminating application - oai_exit=%d\n",oai_exit);
|
||||
#endif
|
||||
LOG_I(ENB_APP,"oai_exit=%d\n",oai_exit);
|
||||
// stop threads
|
||||
|
||||
|
||||
@@ -926,8 +868,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
printf("stopping MODEM threads\n");
|
||||
|
||||
LOG_I(ENB_APP,"stopping MODEM threads\n");
|
||||
stop_eNB(NB_eNB_INST);
|
||||
stop_RU(RC.nb_RU);
|
||||
/* release memory used by the RU/eNB threads (incomplete), after all
|
||||
@@ -961,10 +902,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (opt_enabled == 1)
|
||||
terminate_opt();
|
||||
|
||||
terminate_opt();
|
||||
logClean();
|
||||
printf("Bye.\n");
|
||||
return 0;
|
||||
|
||||
@@ -33,15 +33,8 @@
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
#include "flexran_agent.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
#include "s1ap_eNB.h"
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include "s1ap_eNB.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
|
||||
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
|
||||
@@ -245,6 +238,8 @@
|
||||
#define SOFTMODEM_NOS1_BIT (1<<0)
|
||||
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
|
||||
#define SOFTMODEM_NONBIOT_BIT (1<<2)
|
||||
#define SOFTMODEM_BASICSIM_BIT (1<<10)
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask;
|
||||
THREAD_STRUCT thread_struct;
|
||||
@@ -265,11 +260,12 @@ typedef struct {
|
||||
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
|
||||
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
|
||||
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
|
||||
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
extern uint64_t set_softmodem_optmask(uint64_t bitmask);
|
||||
extern void get_common_options(void);
|
||||
extern softmodem_params_t *get_softmodem_params(void);
|
||||
|
||||
extern unsigned int is_nos1exec(char *exepath) ;
|
||||
uint64_t get_pdcp_optmask(void);
|
||||
extern pthread_cond_t sync_cond;
|
||||
extern pthread_mutex_t sync_mutex;
|
||||
|
||||
@@ -110,10 +110,8 @@ pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
|
||||
uint8_t nfapi_mode = 0;
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#ifdef UESIM_EXPANSION
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
uint16_t inst_pdcp_list[NUMBER_OF_UE_MAX];
|
||||
#endif
|
||||
uint16_t sf_ahead=2;
|
||||
int tddflag;
|
||||
@@ -442,6 +440,10 @@ static void get_options(void) {
|
||||
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
# if BASIC_SIMULATOR
|
||||
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); //this BASIC_SIMULATOR should be a config option
|
||||
# endif
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
@@ -680,10 +682,8 @@ int main( int argc, char **argv ) {
|
||||
#endif
|
||||
int CC_id;
|
||||
uint8_t abstraction_flag=0;
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
#ifdef UESIM_EXPANSION
|
||||
memset(inst_pdcp_list, 0, sizeof(inst_pdcp_list));
|
||||
#endif
|
||||
#endif
|
||||
// Default value for the number of UEs. It will hold,
|
||||
// if not changed from the command line option --num-ues
|
||||
@@ -693,9 +693,7 @@ int main( int argc, char **argv ) {
|
||||
int ret;
|
||||
#endif
|
||||
configmodule_interface_t *config_mod;
|
||||
|
||||
start_background_system();
|
||||
|
||||
config_mod = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY);
|
||||
|
||||
if (config_mod == NULL) {
|
||||
@@ -711,6 +709,11 @@ int main( int argc, char **argv ) {
|
||||
for (int i=0; i<MAX_NUM_CCs; i++) tx_max_power[i]=23;
|
||||
|
||||
get_options ();
|
||||
|
||||
if (is_nos1exec(argv[0]) )
|
||||
set_softmodem_optmask(SOFTMODEM_NOS1_BIT);
|
||||
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1;
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
|
||||
if (NB_UE_INST > 1 && simL1flag != 1 && nfapi_mode != 3) {
|
||||
@@ -721,15 +724,17 @@ int main( int argc, char **argv ) {
|
||||
printf("NFAPI_MODE value: %d \n", nfapi_mode);
|
||||
|
||||
// Checking option of nums_ue_thread.
|
||||
if(NB_THREAD_INST < 1){
|
||||
if(NB_THREAD_INST < 1) {
|
||||
printf("Running with 0 UE rxtx thread, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Checking option's relation between nums_ue_thread and num-ues
|
||||
if(NB_UE_INST <NB_THREAD_INST ){
|
||||
if(NB_UE_INST <NB_THREAD_INST ) {
|
||||
printf("Number of UEs < number of UE rxtx threads, exiting.\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
// Not sure if the following is needed here
|
||||
/*if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
if (UE_flag == 0) {
|
||||
@@ -741,8 +746,6 @@ int main( int argc, char **argv ) {
|
||||
nfapi_mode = 4;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
@@ -763,13 +766,13 @@ int main( int argc, char **argv ) {
|
||||
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
|
||||
#endif
|
||||
init_opt();
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
printf("PDCP netlink\n");
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
uint32_t pdcp_initmask = ((!IS_SOFTMODEM_NOS1) || IS_SOFTMODEM_NOKRNMOD)? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
|
||||
|
||||
if ( IS_SOFTMODEM_BASICSIM || (nfapi_mode == 3) ) {
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
}
|
||||
|
||||
pdcp_module_init( pdcp_initmask );
|
||||
//TTN for D2D
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
printf ("RRC control socket\n");
|
||||
@@ -817,38 +820,6 @@ int main( int argc, char **argv ) {
|
||||
RCConfig_sim();
|
||||
}
|
||||
|
||||
// source code written in below moved to later to avoid keeping waiting for nfapi_sync_cond in wait_nfapi_init.
|
||||
/*
|
||||
// start the main UE threads
|
||||
int eMBMS_active = 0;
|
||||
|
||||
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
} else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (nfapi_mode!=3) {
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
#ifndef DEADLINE_SCHEDULER
|
||||
printf("NO deadline scheduler\n");
|
||||
@@ -880,7 +851,7 @@ int main( int argc, char **argv ) {
|
||||
exit_fun("Error getting processor affinity ");
|
||||
}
|
||||
|
||||
memset(cpu_affinity, 0 , sizeof(cpu_affinity));
|
||||
memset(cpu_affinity, 0, sizeof(cpu_affinity));
|
||||
|
||||
for (int j = 0; j < CPU_SETSIZE; j++) {
|
||||
if (CPU_ISSET(j, &cpuset)) {
|
||||
@@ -893,6 +864,7 @@ int main( int argc, char **argv ) {
|
||||
LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
|
||||
#endif
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
if (create_tasks_ue(NB_UE_INST) < 0) {
|
||||
printf("cannot create ITTI tasks\n");
|
||||
exit(-1); // need a softer mode
|
||||
@@ -938,33 +910,32 @@ int main( int argc, char **argv ) {
|
||||
|
||||
printf("NFAPI MODE:%s\n", nfapi_mode_str);
|
||||
|
||||
if (nfapi_mode==3) // UE-STUB-PNF
|
||||
{
|
||||
if (nfapi_mode==3) { // UE-STUB-PNF
|
||||
config_sync_var=0;
|
||||
wait_nfapi_init("main?");
|
||||
//Panos: Temporarily we will be using single set of threads for multiple UEs.
|
||||
//init_UE_stub(1,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
init_UE_stub_single_thread(NB_UE_INST,eMBMS_active,uecap_xer_in,emul_iface);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
init_UE(NB_UE_INST,eMBMS_active,uecap_xer_in,0,get_softmodem_params()->phy_test,UE_scan,UE_scan_carrier,mode,(int)rx_gain[0][0],tx_max_power[0],
|
||||
frame_parms[0]);
|
||||
}
|
||||
|
||||
|
||||
if (get_softmodem_params()->phy_test==0) {
|
||||
printf("Filling UE band info\n");
|
||||
fill_ue_band_info();
|
||||
dl_phy_sync_success (0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if (nfapi_mode!=3){
|
||||
if (nfapi_mode!=3) {
|
||||
number_of_cards = 1;
|
||||
|
||||
for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
}
|
||||
}
|
||||
|
||||
// connect the TX/RX buffers
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user