Merge branch 'develop_integration_2018_w39' into 'develop'
Develop integration 2018 w39 See merge request oai/openairinterface5g!405
This commit is contained in:
@@ -31,6 +31,9 @@ def testXMLFile = params.pythonTestXmlFile
|
||||
// Name of the test stage
|
||||
def testStageName = params.pipelineTestStageName
|
||||
|
||||
// Name of the phone resource
|
||||
def ciSmartPhoneResource = params.smartphonesResource
|
||||
|
||||
// Terminate Status
|
||||
def termUE = 0
|
||||
def termENB = 1
|
||||
@@ -70,6 +73,7 @@ pipeline {
|
||||
string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run')
|
||||
string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage')
|
||||
booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact')
|
||||
string(name: 'smartphonesResource', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource')
|
||||
|
||||
//eNB parameters
|
||||
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
|
||||
@@ -112,6 +116,9 @@ pipeline {
|
||||
testStageName = 'Template Test Stage'
|
||||
}
|
||||
|
||||
if (params.smartphonesResource == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.eNB_IPAddress == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
@@ -178,6 +185,7 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
dir ('ci-scripts') {
|
||||
lock (ciSmartPhoneResource) {
|
||||
try {
|
||||
echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
|
||||
withCredentials([
|
||||
@@ -190,6 +198,7 @@ pipeline {
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,21 +120,34 @@ echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Merged Commit is : $MERGE_COMMMIT"
|
||||
echo "Target Init is : $TARGET_INIT_COMMIT"
|
||||
echo ""
|
||||
echo " ----------------------------------------------------------"
|
||||
echo ""
|
||||
|
||||
# Retrieve the list of modified files since the latest develop commit
|
||||
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
|
||||
NB_TO_FORMAT=0
|
||||
if [ -f oai_rules_result_list.txt ]
|
||||
then
|
||||
rm -f oai_rules_result_list.txt
|
||||
fi
|
||||
for FULLFILE in $MODIFIED_FILES
|
||||
do
|
||||
echo $FULLFILE
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
EXT="${filename##*.}"
|
||||
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
|
||||
then
|
||||
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
|
||||
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
|
||||
if [ $TO_FORMAT -ne 0 ]
|
||||
then
|
||||
echo $FULLFILE
|
||||
echo $FULLFILE >> ./oai_rules_result_list.txt
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo ""
|
||||
echo " ----------------------------------------------------------"
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
|
||||
echo $NB_TO_FORMAT > ./oai_rules_result.txt
|
||||
|
||||
|
||||
@@ -228,6 +228,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
|
||||
@@ -228,6 +228,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
|
||||
@@ -228,6 +228,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
|
||||
@@ -229,6 +229,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
|
||||
+39
-27
@@ -90,38 +90,50 @@ class SSHConnection():
|
||||
self.htmlUEConnected = 0
|
||||
|
||||
def open(self, ipaddress, username, password):
|
||||
self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress], timeout = 5)
|
||||
self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
self.ssh.sendline('yes')
|
||||
self.ssh.expect('password:')
|
||||
self.ssh.sendline(password)
|
||||
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
count = 0
|
||||
connect_status = False
|
||||
while count < 4:
|
||||
self.ssh = pexpect.spawn('ssh', [username + '@' + ipaddress], timeout = 5)
|
||||
self.sshresponse = self.ssh.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', 'Last login', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
pass
|
||||
self.ssh.sendline('yes')
|
||||
self.ssh.expect('password:')
|
||||
self.ssh.sendline(password)
|
||||
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
count = 10
|
||||
connect_status = True
|
||||
else:
|
||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||
elif self.sshresponse == 1:
|
||||
self.ssh.sendline(password)
|
||||
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
count = 10
|
||||
connect_status = True
|
||||
else:
|
||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||
elif self.sshresponse == 2:
|
||||
# Checking if we are really on the remote client defined by its IP address
|
||||
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:"', '\$', 5)
|
||||
result = re.search(str(ipaddress), str(self.ssh.before))
|
||||
if result is None:
|
||||
self.close()
|
||||
else:
|
||||
count = 10
|
||||
connect_status = True
|
||||
else:
|
||||
# debug output
|
||||
logging.debug(str(self.ssh.before))
|
||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||
sys.exit('SSH Connection Failed')
|
||||
elif self.sshresponse == 1:
|
||||
self.ssh.sendline(password)
|
||||
self.sshresponse = self.ssh.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if self.sshresponse == 0:
|
||||
pass
|
||||
else:
|
||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||
sys.exit('SSH Connection Failed')
|
||||
elif self.sshresponse == 2:
|
||||
# Checking if we are really on the remote client defined by its IP address
|
||||
self.command('stdbuf -o0 ifconfig | egrep --color=never "inet addr:"', '\$', 5)
|
||||
result = re.search(str(ipaddress), str(self.ssh.before))
|
||||
if result is None:
|
||||
sys.exit('SSH Connection Failed: TIMEOUT !!!')
|
||||
# adding a tempo when failure
|
||||
if not connect_status:
|
||||
time.sleep(1)
|
||||
count += 1
|
||||
if connect_status:
|
||||
pass
|
||||
else:
|
||||
# debug output
|
||||
logging.debug(str(self.ssh.before))
|
||||
logging.debug('self.sshresponse = ' + str(self.sshresponse))
|
||||
sys.exit('SSH Connection Failed!!!')
|
||||
sys.exit('SSH Connection Failed')
|
||||
|
||||
def command(self, commandline, expectedline, timeout):
|
||||
logging.debug(commandline)
|
||||
|
||||
@@ -260,7 +260,7 @@ function sca_summary_table_footer {
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
|
||||
echo " <p>Graphical Interface tool : <code>cppcheck-gui -l cppcheck/cppcheck.xml</code> </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
|
||||
}
|
||||
|
||||
jb_checker=0
|
||||
@@ -490,12 +490,20 @@ then
|
||||
then
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
else
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
if [ -f ./oai_rules_result_list.txt ]
|
||||
then
|
||||
awk '{print " <tr><td></td><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
|
||||
fi
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <p>Please apply the following command to this(ese) file(s): </p>" >> ./build_results.html
|
||||
echo " <p style=\"margin-left: 30px\"><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
fi
|
||||
|
||||
echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html
|
||||
|
||||
@@ -474,12 +474,12 @@ include_directories ("${X2AP_DIR}")
|
||||
|
||||
add_library(X2AP_ENB
|
||||
${X2AP_DIR}/x2ap_eNB.c
|
||||
# ${X2AP_DIR}/x2ap_eNB_decoder.c
|
||||
# ${X2AP_DIR}/x2ap_eNB_encoder.c
|
||||
${X2AP_DIR}/x2ap_eNB_decoder.c
|
||||
${X2AP_DIR}/x2ap_eNB_encoder.c
|
||||
${X2AP_DIR}/x2ap_eNB_handler.c
|
||||
# ${X2AP_DIR}/x2ap_eNB_itti_messaging.c
|
||||
${X2AP_DIR}/x2ap_eNB_itti_messaging.c
|
||||
${X2AP_DIR}/x2ap_eNB_management_procedures.c
|
||||
# ${X2AP_DIR}/x2ap_eNB_generate_messages.c
|
||||
${X2AP_DIR}/x2ap_eNB_generate_messages.c
|
||||
)
|
||||
|
||||
# Hardware dependant options
|
||||
|
||||
@@ -63,6 +63,8 @@ typedef enum {
|
||||
MSC_S6A_MME,
|
||||
MSC_HSS,
|
||||
MAX_MSC_PROTOS,
|
||||
MSC_X2AP_SRC_ENB,
|
||||
MSC_X2AP_TARGET_ENB,
|
||||
} msc_proto_t;
|
||||
|
||||
|
||||
|
||||
@@ -115,11 +115,15 @@ extern "C" {
|
||||
task_list_t *t=&tasks[destination_task_id];
|
||||
pthread_mutex_lock (&t->queue_cond_lock);
|
||||
int ret=itti_send_msg_to_task_locked(destination_task_id, instance, message);
|
||||
pthread_mutex_unlock (&t->queue_cond_lock);
|
||||
|
||||
while ( t->message_queue.size()>0 && t->admin.func != NULL )
|
||||
while ( t->message_queue.size()>0 && t->admin.func != NULL ) {
|
||||
if (t->message_queue.size()>1)
|
||||
LOG_W(TMR,"queue in no thread mode is %ld\n", t->message_queue.size());
|
||||
pthread_mutex_unlock (&t->queue_cond_lock);
|
||||
t->admin.func(NULL);
|
||||
|
||||
pthread_mutex_lock (&t->queue_cond_lock);
|
||||
}
|
||||
pthread_mutex_unlock (&t->queue_cond_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -193,6 +197,8 @@ extern "C" {
|
||||
pthread_mutex_unlock(&t->queue_cond_lock);
|
||||
LOG_D(TMR,"enter blocking wait for %s\n", itti_get_task_name(task_id));
|
||||
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
|
||||
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
|
||||
pthread_mutex_lock(&t->queue_cond_lock);
|
||||
} while (t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) );
|
||||
|
||||
AssertFatal (t->nb_events >=0,
|
||||
@@ -278,6 +284,18 @@ extern "C" {
|
||||
"Thread creation for task %d failed!\n", task_id);
|
||||
pthread_setname_np( t->thread, itti_get_task_name(task_id) );
|
||||
LOG_I(TMR,"Created Posix thread %s\n", itti_get_task_name(task_id) );
|
||||
#if 1 // BMC test RT prio
|
||||
{
|
||||
int policy;
|
||||
struct sched_param sparam;
|
||||
memset(&sparam, 0, sizeof(sparam));
|
||||
sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-10;
|
||||
policy = SCHED_FIFO ;
|
||||
if (pthread_setschedparam(t->thread, policy, &sparam) != 0) {
|
||||
LOG_E(TMR,"task %s : Failed to set pthread priority\n", itti_get_task_name(task_id) );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +233,11 @@ typedef struct IttiMsgText_s {
|
||||
#include <openair3/S1AP/s1ap_eNB.h>
|
||||
//#include <proto.h>
|
||||
|
||||
#include <openair3/GTPV1-U/gtpv1u_eNB_task.h>
|
||||
void *rrc_enb_process_itti_msg(void *);
|
||||
#include <openair3/SCTP/sctp_eNB_task.h>
|
||||
#include <openair3/S1AP/s1ap_eNB.h>
|
||||
|
||||
/*
|
||||
static const char *const messages_definition_xml = {
|
||||
#include <messages_xml.h>
|
||||
|
||||
@@ -169,6 +169,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
|
||||
}
|
||||
else ru->N_TA_offset=0;
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
/* this is required for the basic simulator in TDD mode
|
||||
* TODO: find a proper cleaner solution
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
#endif
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
uint64_t runtime,
|
||||
uint64_t deadline,
|
||||
uint64_t period);*/
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
extern int codingw;
|
||||
|
||||
void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
{
|
||||
@@ -615,8 +615,10 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
}
|
||||
|
||||
if(C >= 8 && get_nprocs()>=16 && codingw)//one main three worker
|
||||
if(get_thread_worker_conf() == WORKER_ENABLE)
|
||||
{
|
||||
if(C >= 8)//one main three worker
|
||||
{
|
||||
encoding_return =
|
||||
dlsch_encoding_2threads(eNB,
|
||||
a,
|
||||
@@ -632,9 +634,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
te_wakeup_stats1,
|
||||
i_stats,
|
||||
3);
|
||||
}
|
||||
else if(C >= 6 && get_nprocs()>=8 && codingw)//one main two worker
|
||||
{
|
||||
}
|
||||
else if(C >= 6)//one main two worker
|
||||
{
|
||||
encoding_return =
|
||||
dlsch_encoding_2threads(eNB,
|
||||
a,
|
||||
@@ -650,9 +652,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
te_wakeup_stats1,
|
||||
i_stats,
|
||||
2);
|
||||
}
|
||||
else if(C >= 4 && get_nprocs()>=4 && codingw)//one main one worker
|
||||
{
|
||||
}
|
||||
else if(C >= 4)//one main one worker
|
||||
{
|
||||
encoding_return =
|
||||
dlsch_encoding_2threads(eNB,
|
||||
a,
|
||||
@@ -668,9 +670,9 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
te_wakeup_stats1,
|
||||
i_stats,
|
||||
1);
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
encoding_return =
|
||||
dlsch_encoding(eNB,
|
||||
a,
|
||||
@@ -681,7 +683,21 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
rm_stats,
|
||||
te_stats,
|
||||
i_stats);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
encoding_return =
|
||||
dlsch_encoding(eNB,
|
||||
a,
|
||||
num_pdcch_symbols,
|
||||
dlsch,
|
||||
frame,
|
||||
subframe,
|
||||
rm_stats,
|
||||
te_stats,
|
||||
i_stats);
|
||||
}
|
||||
return encoding_return;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include "targets/RT/USER/rt_wrapper.h"
|
||||
#include "transport_proto.h"
|
||||
|
||||
extern int codingw;
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
|
||||
{
|
||||
@@ -723,7 +723,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
int ulsch_decoding_data_all(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
|
||||
{
|
||||
int ret = 0;
|
||||
/*if(codingw)
|
||||
/*if(get_thread_worker_conf() == WORKER_ENABLE)
|
||||
{
|
||||
ret = ulsch_decoding_data_2thread(eNB,UE_id,harq_pid,llr8_flag);
|
||||
}
|
||||
|
||||
@@ -862,7 +862,22 @@ typedef enum {
|
||||
RESYNCH=4
|
||||
} UE_MODE_t;
|
||||
|
||||
/// Threading Parameter
|
||||
typedef enum {
|
||||
PARALLEL_SINGLE_THREAD =0,
|
||||
PARALLEL_RU_L1_SPLIT =1,
|
||||
PARALLEL_RU_L1_TRX_SPLIT =2
|
||||
}PARALLEL_CONF_t;
|
||||
|
||||
typedef enum {
|
||||
WORKER_DISABLE =0,
|
||||
WORKER_ENABLE =1
|
||||
}WORKER_CONF_t;
|
||||
|
||||
typedef struct THREAD_STRUCT_s {
|
||||
PARALLEL_CONF_t parallel_conf;
|
||||
WORKER_CONF_t worker_conf;
|
||||
} THREAD_STRUCT;
|
||||
|
||||
typedef enum {SF_DL, SF_UL, SF_S} lte_subframe_t;
|
||||
|
||||
|
||||
@@ -270,7 +270,6 @@ typedef enum {
|
||||
REMOTE_IF4p5 =3,
|
||||
REMOTE_IF1pp =4,
|
||||
MAX_RU_IF_TYPES =5
|
||||
//EMULATE_RF =6
|
||||
} RU_if_south_t;
|
||||
|
||||
typedef struct RU_t_s{
|
||||
|
||||
@@ -82,7 +82,30 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for rx */
|
||||
int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
|
||||
int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
|
||||
|
||||
int codingw = 0;
|
||||
char *parallel_config = NULL;
|
||||
char *worker_config = NULL;
|
||||
static THREAD_STRUCT thread_struct;
|
||||
void set_parallel_conf(char *parallel_conf)
|
||||
{
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf)
|
||||
{
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void)
|
||||
{
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void)
|
||||
{
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
int emulate_rf = 0;
|
||||
|
||||
@@ -1041,6 +1064,8 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_parallel_conf("PARALLEL_RU_L1_TRX_SPLIT");
|
||||
set_worker_conf("WORKER_ENABLE");
|
||||
|
||||
if (transmission_mode>1) pa=dBm3;
|
||||
printf("dlsim: tmode %d, pa %d\n",transmission_mode,pa);
|
||||
|
||||
@@ -97,7 +97,30 @@ nfapi_tx_request_pdu_t tx_pdu_list[MAX_NUM_TX_REQUEST_PDU];
|
||||
nfapi_tx_request_t TX_req;
|
||||
Sched_Rsp_t sched_resp;
|
||||
|
||||
int codingw = 0;
|
||||
char *parallel_config = NULL;
|
||||
char *worker_config = NULL;
|
||||
static THREAD_STRUCT thread_struct;
|
||||
void set_parallel_conf(char *parallel_conf)
|
||||
{
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf)
|
||||
{
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void)
|
||||
{
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void)
|
||||
{
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
void
|
||||
fill_nfapi_ulsch_config_request(nfapi_ul_config_request_pdu_t *ul_config_pdu,
|
||||
@@ -725,6 +748,8 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_parallel_conf("PARALLEL_RU_L1_TRX_SPLIT");
|
||||
set_worker_conf("WORKER_ENABLE");
|
||||
RC.nb_L1_inst = 1;
|
||||
RC.nb_RU = 1;
|
||||
|
||||
|
||||
@@ -25,3 +25,4 @@ MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_del
|
||||
MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp)
|
||||
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd)
|
||||
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_S1_REQ, MESSAGE_PRIORITY_MED, Gtpv1uS1Req, gtpv1uS1Req)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
|
||||
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
|
||||
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
|
||||
#define GTPV1U_ENB_S1_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uS1Req
|
||||
|
||||
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
||||
|
||||
@@ -98,4 +99,8 @@ typedef struct gtpv1u_enb_tunnel_data_req_s {
|
||||
rb_id_t rab_id;
|
||||
} gtpv1u_enb_tunnel_data_req_t;
|
||||
|
||||
typedef struct {
|
||||
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
|
||||
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
|
||||
} Gtpv1uS1Req;
|
||||
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -63,17 +63,21 @@ typedef struct x2ap_register_enb_req_s {
|
||||
uint8_t mnc_digit_length;
|
||||
|
||||
/*
|
||||
* EARFCN
|
||||
* CC Params
|
||||
*/
|
||||
uint16_t fdd_uL_EARFCN;
|
||||
uint16_t fdd_dL_EARFCN;
|
||||
uint16_t tdd_EARFCN;
|
||||
|
||||
|
||||
uint16_t fdd_uL_Transmission_Bandwidth;
|
||||
uint16_t fdd_dL_Transmission_Bandwidth;
|
||||
uint16_t tdd_Transmission_Bandwidth;
|
||||
int16_t eutra_band[MAX_NUM_CCs];
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs];
|
||||
uint32_t Nid_cell[MAX_NUM_CCs];
|
||||
int16_t N_RB_DL[MAX_NUM_CCs];
|
||||
lte_frame_type_t frame_type[MAX_NUM_CCs];
|
||||
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
|
||||
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
|
||||
int num_cc;
|
||||
|
||||
/* To be considered for TDD */
|
||||
//uint16_t tdd_EARFCN;
|
||||
//uint16_t tdd_Transmission_Bandwidth;
|
||||
|
||||
/* The local eNB IP address to bind */
|
||||
net_ip_address_t enb_x2_ip_address;
|
||||
|
||||
+2243
-2255
File diff suppressed because it is too large
Load Diff
@@ -879,3 +879,28 @@ typedef enum {
|
||||
#define MACRLC_SCHED_MODE_IDX 17
|
||||
#define MACRLC_PHY_TEST_IDX 18
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/* thread configuration parameters section name */
|
||||
#define THREAD_CONFIG_STRING_THREAD_STRUCT "THREAD_STRUCT"
|
||||
|
||||
/* thread configuration parameters names */
|
||||
#define THREAD_CONFIG_STRING_PARALLEL "parallel_config"
|
||||
#define THREAD_CONFIG_STRING_WORKER "worker_config"
|
||||
|
||||
|
||||
#define THREAD_PARALLEL_IDX 0
|
||||
#define THREAD_WORKER_IDX 1
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* thread configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define THREAD_CONF_DESC { \
|
||||
{THREAD_CONFIG_STRING_PARALLEL, CONFIG_HLP_PARALLEL, 0, strptr:NULL, defstrval:"PARALLEL_RU_L1_TRX_SPLIT", TYPE_STRING, 0}, \
|
||||
{THREAD_CONFIG_STRING_WORKER, CONFIG_HLP_WORKER, 0, strptr:NULL, defstrval:"WORKER_ENABLE", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
|
||||
#define CONFIG_HLP_WORKER "coding and FEP worker thread WORKER_DISABLE or WORKER_ENABLE\n"
|
||||
#define CONFIG_HLP_PARALLEL "PARALLEL_SINGLE_THREAD, PARALLEL_RU_L1_SPLIT, or PARALLEL_RU_L1_TRX_SPLIT(RU_L1_TRX_SPLIT by defult)\n"
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -160,6 +160,58 @@ uint32_t to_earfcn(int eutra_bandP, uint32_t dl_CarrierFreq, uint32_t bw)
|
||||
(eutra_bandtable[i].N_OFFs_DL / 10));
|
||||
}
|
||||
|
||||
uint32_t to_earfcn_DL(int eutra_bandP, long long int dl_CarrierFreq, uint32_t bw)
|
||||
{
|
||||
|
||||
uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq / 100000;
|
||||
int bw_by_100 = bw / 100;
|
||||
|
||||
int i;
|
||||
|
||||
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP);
|
||||
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(dl_CarrierFreq_by_100k >= eutra_bandtable[i].dl_min,
|
||||
"Band %d, bw %u : DL carrier frequency %lld Hz < %u\n",
|
||||
eutra_bandP, bw, dl_CarrierFreq,
|
||||
eutra_bandtable[i].dl_min);
|
||||
AssertFatal(dl_CarrierFreq_by_100k <=
|
||||
(eutra_bandtable[i].dl_max - bw_by_100),
|
||||
"Band %d, bw %u : DL carrier frequency %lld Hz > %d\n",
|
||||
eutra_bandP, bw, dl_CarrierFreq,
|
||||
eutra_bandtable[i].dl_max - bw_by_100);
|
||||
|
||||
|
||||
return (dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min +
|
||||
(eutra_bandtable[i].N_OFFs_DL / 10));
|
||||
}
|
||||
|
||||
uint32_t to_earfcn_UL(int eutra_bandP, long long int ul_CarrierFreq, uint32_t bw)
|
||||
{
|
||||
|
||||
uint32_t ul_CarrierFreq_by_100k = ul_CarrierFreq / 100000;
|
||||
int bw_by_100 = bw / 100;
|
||||
|
||||
int i;
|
||||
|
||||
AssertFatal(eutra_bandP < 69, "eutra_band %d > 68\n", eutra_bandP);
|
||||
for (i = 0; i < 69 && eutra_bandtable[i].band != eutra_bandP; i++);
|
||||
|
||||
AssertFatal(ul_CarrierFreq_by_100k >= eutra_bandtable[i].ul_min,
|
||||
"Band %d, bw %u : UL carrier frequency %lld Hz < %u\n",
|
||||
eutra_bandP, bw, ul_CarrierFreq,
|
||||
eutra_bandtable[i].ul_min);
|
||||
AssertFatal(ul_CarrierFreq_by_100k <=
|
||||
(eutra_bandtable[i].ul_max - bw_by_100),
|
||||
"Band %d, bw %u : UL carrier frequency %lld Hz > %d\n",
|
||||
eutra_bandP, bw, ul_CarrierFreq,
|
||||
eutra_bandtable[i].ul_max - bw_by_100);
|
||||
|
||||
|
||||
return (ul_CarrierFreq_by_100k - eutra_bandtable[i].ul_min +
|
||||
((eutra_bandtable[i].N_OFFs_DL + 180000) / 10));
|
||||
}
|
||||
|
||||
uint32_t from_earfcn(int eutra_bandP, uint32_t dl_earfcn)
|
||||
{
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ schedule_ue_spec_phy_test(
|
||||
uint16_t rnti = 0x1235;
|
||||
uint32_t rb_alloc = 0x1FFFFF;
|
||||
int32_t tpc = 1;
|
||||
int32_t mcs = 10;
|
||||
int32_t mcs = 28;
|
||||
int32_t cqi = 15;
|
||||
int32_t ndi = (frameP*10+subframeP)/8;
|
||||
int32_t dai = 0;
|
||||
|
||||
+34
-20
@@ -7201,29 +7201,24 @@ void rrc_eNB_reconfigure_DRBs (const protocol_ctxt_t* const ctxt_pP,
|
||||
rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(ctxt_pP, ue_context_pP, 0);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void*
|
||||
rrc_enb_task(
|
||||
void* args_p
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
MessageDef *msg_p;
|
||||
const char *msg_name_p;
|
||||
instance_t instance;
|
||||
int result;
|
||||
SRB_INFO *srb_info_p;
|
||||
int CC_id;
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
void rrc_enb_init(void) {
|
||||
pthread_mutex_init(&lock_ue_freelist, NULL);
|
||||
pthread_mutex_init(&rrc_release_freelist, NULL);
|
||||
memset(&rrc_release_info,0,sizeof(RRC_release_list_t));
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
LOG_I(RRC,"Entering main loop of RRC message task\n");
|
||||
while (1) {
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
MessageDef *msg_p;
|
||||
const char *msg_name_p;
|
||||
instance_t instance;
|
||||
int result;
|
||||
SRB_INFO *srb_info_p;
|
||||
int CC_id;
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
// Wait for a message
|
||||
itti_receive_msg(TASK_RRC_ENB, &msg_p);
|
||||
|
||||
@@ -7363,9 +7358,28 @@ rrc_enb_task(
|
||||
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
if (result != EXIT_SUCCESS) {
|
||||
LOG_I(RRC, "Failed to free memory (%d)!\n",result);
|
||||
continue;
|
||||
}
|
||||
msg_p = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void*
|
||||
rrc_enb_task(
|
||||
void* args_p
|
||||
)
|
||||
//-----------------------------------------------------------------------------
|
||||
{
|
||||
rrc_enb_init();
|
||||
|
||||
itti_mark_task_ready(TASK_RRC_ENB);
|
||||
LOG_I(RRC,"Entering main loop of RRC message task\n");
|
||||
|
||||
|
||||
while (1) {
|
||||
|
||||
(void) rrc_enb_process_itti_msg(NULL);
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -336,6 +336,10 @@ 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 *);
|
||||
|
||||
/**\brief RRC eNB task.
|
||||
\param void *args_p Pointer on arguments to start the task. */
|
||||
void *rrc_enb_task(void *args_p);
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
#include "X2AP_InitiatingMessage.h"
|
||||
#include "X2AP_SuccessfulOutcome.h"
|
||||
#include "X2AP_UnsuccessfulOutcome.h"
|
||||
#include "X2AP_ProtocolIE-Field.h"
|
||||
#include "X2AP_ProtocolIE-FieldPair.h"
|
||||
#include "X2AP_ProtocolIE-ContainerPair.h"
|
||||
#include "X2AP_ProtocolExtensionField.h"
|
||||
#include "X2AP_ProtocolExtensionContainer.h"
|
||||
#include "X2AP_asn_constant.h"
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#ifndef X2AP_COMMON_H_
|
||||
#define X2AP_COMMON_H_
|
||||
@@ -87,15 +87,13 @@ extern int asn1_xer_print;
|
||||
if (mandatory) DevAssert(ie != NULL); \
|
||||
} while(0)
|
||||
|
||||
//Forward declaration
|
||||
struct x2ap_message_s;
|
||||
|
||||
/** \brief Function callback prototype.
|
||||
**/
|
||||
typedef int (*x2ap_message_decoded_callback)(
|
||||
instance_t instance,
|
||||
uint32_t assocId,
|
||||
uint32_t stream,
|
||||
struct x2ap_message_s *message);
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
/** \brief Encode a successfull outcome message
|
||||
\param buffer pointer to buffer in which data will be encoded
|
||||
|
||||
+24
-11
@@ -31,6 +31,7 @@
|
||||
#include "x2ap_eNB_defs.h"
|
||||
#include "x2ap_eNB_management_procedures.h"
|
||||
#include "x2ap_eNB_handler.h"
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
#include "x2ap_common.h"
|
||||
|
||||
#include "queue.h"
|
||||
@@ -42,9 +43,9 @@ struct x2ap_eNB_data_s;
|
||||
|
||||
RB_PROTOTYPE(x2ap_enb_map, x2ap_eNB_data_s, entry, x2ap_eNB_compare_assoc_id);
|
||||
|
||||
//static
|
||||
//void x2ap_eNB_handle_sctp_data_ind(instance_t instance,
|
||||
// sctp_data_ind_t *sctp_data_ind);
|
||||
static
|
||||
void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind);
|
||||
|
||||
static
|
||||
void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
|
||||
|
||||
@@ -63,22 +64,21 @@ void x2ap_eNB_register_eNB(x2ap_eNB_instance_t *instance_p,
|
||||
uint32_t enb_port_for_X2C,
|
||||
int multi_sd);
|
||||
|
||||
/*
|
||||
|
||||
static
|
||||
void x2ap_eNB_handle_sctp_data_ind(instance_t instance,
|
||||
sctp_data_ind_t *sctp_data_ind) {
|
||||
void x2ap_eNB_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
|
||||
|
||||
int result;
|
||||
|
||||
DevAssert(sctp_data_ind != NULL);
|
||||
|
||||
x2ap_eNB_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
x2ap_eNB_handle_message(instance, sctp_data_ind->assoc_id, sctp_data_ind->stream,
|
||||
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
|
||||
|
||||
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
static
|
||||
void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
|
||||
@@ -143,7 +143,7 @@ printf("x2ap_eNB_handle_sctp_association_resp at 4\n");
|
||||
dump_trees();
|
||||
|
||||
/* Prepare new x2 Setup Request */
|
||||
//x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
x2ap_eNB_generate_x2_setup_request(instance_p, x2ap_enb_data_p);
|
||||
}
|
||||
|
||||
static
|
||||
@@ -325,6 +325,19 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
|
||||
new_instance->mnc = x2ap_register_eNB->mnc;
|
||||
new_instance->mnc_digit_length = x2ap_register_eNB->mnc_digit_length;
|
||||
|
||||
new_instance->num_cc = x2ap_register_eNB->num_cc;
|
||||
|
||||
for (int i = 0; i< x2ap_register_eNB->num_cc; i++){
|
||||
new_instance->eutra_band[i] = x2ap_register_eNB->eutra_band[i];
|
||||
new_instance->downlink_frequency[i] = x2ap_register_eNB->downlink_frequency[i];
|
||||
new_instance->uplink_frequency_offset[i] = x2ap_register_eNB->uplink_frequency_offset[i];
|
||||
new_instance->Nid_cell[i] = x2ap_register_eNB->Nid_cell[i];
|
||||
new_instance->N_RB_DL[i] = x2ap_register_eNB->N_RB_DL[i];
|
||||
new_instance->frame_type[i] = x2ap_register_eNB->frame_type[i];
|
||||
new_instance->fdd_earfcn_DL[i] = x2ap_register_eNB->fdd_earfcn_DL[i];
|
||||
new_instance->fdd_earfcn_UL[i] = x2ap_register_eNB->fdd_earfcn_UL[i];
|
||||
}
|
||||
|
||||
DevCheck(x2ap_register_eNB->nb_x2 <= X2AP_MAX_NB_ENB_IP_ADDRESS,
|
||||
X2AP_MAX_NB_ENB_IP_ADDRESS, x2ap_register_eNB->nb_x2, 0);
|
||||
memcpy(new_instance->target_enb_x2_ip_address,
|
||||
@@ -432,8 +445,8 @@ void *x2ap_task(void *arg)
|
||||
break;
|
||||
|
||||
case SCTP_DATA_IND:
|
||||
//x2ap_eNB_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
// &received_msg->ittiMsg.sctp_data_ind);
|
||||
x2ap_eNB_handle_sctp_data_ind(ITTI_MESSAGE_GET_INSTANCE(received_msg),
|
||||
&received_msg->ittiMsg.sctp_data_ind);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "x2ap_common.h"
|
||||
#include "x2ap_eNB_decoder.h"
|
||||
|
||||
static int x2ap_eNB_decode_initiating_message(X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.initiatingMessage.procedureCode) {
|
||||
|
||||
case X2AP_ProcedureCode_id_x2Setup:
|
||||
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_initiating_message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
|
||||
(int)pdu->choice.initiatingMessage.procedureCode);
|
||||
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
|
||||
(int)pdu->choice.initiatingMessage.procedureCode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int x2ap_eNB_decode_successful_outcome(X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.successfulOutcome.procedureCode) {
|
||||
case X2AP_ProcedureCode_id_x2Setup:
|
||||
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_successfuloutcome_message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n",
|
||||
(int)pdu->choice.successfulOutcome.procedureCode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int x2ap_eNB_decode_unsuccessful_outcome(X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
|
||||
case X2AP_ProcedureCode_id_x2Setup:
|
||||
asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
X2AP_INFO("x2ap_eNB_decode_unsuccessfuloutcome_message!\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
X2AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
|
||||
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
|
||||
{
|
||||
asn_dec_rval_t dec_ret;
|
||||
|
||||
DevAssert(buffer != NULL);
|
||||
|
||||
dec_ret = aper_decode(NULL,
|
||||
&asn_DEF_X2AP_X2AP_PDU,
|
||||
(void **)&pdu,
|
||||
buffer,
|
||||
length,
|
||||
0,
|
||||
0);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
X2AP_ERROR("Failed to decode pdu\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(pdu->present) {
|
||||
case X2AP_X2AP_PDU_PR_initiatingMessage:
|
||||
return x2ap_eNB_decode_initiating_message(pdu);
|
||||
|
||||
case X2AP_X2AP_PDU_PR_successfulOutcome:
|
||||
return x2ap_eNB_decode_successful_outcome(pdu);
|
||||
|
||||
case X2AP_X2AP_PDU_PR_unsuccessfulOutcome:
|
||||
return x2ap_eNB_decode_unsuccessful_outcome(pdu);
|
||||
|
||||
default:
|
||||
X2AP_DEBUG("Unknown presence (%d) or not implemented\n", (int)pdu->present);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef X2AP_ENB_DECODER_H_
|
||||
#define X2AP_ENB_DECODER_H_
|
||||
|
||||
int x2ap_eNB_decode_pdu(X2AP_X2AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#endif /* X2AP_ENB_DECODER_H_ */
|
||||
|
||||
@@ -151,6 +151,17 @@ typedef struct x2ap_eNB_instance_s {
|
||||
uint16_t mnc;
|
||||
uint8_t mnc_digit_length;
|
||||
|
||||
/* CC params */
|
||||
int16_t eutra_band[MAX_NUM_CCs];
|
||||
uint32_t downlink_frequency[MAX_NUM_CCs];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs];
|
||||
uint32_t Nid_cell[MAX_NUM_CCs];
|
||||
int16_t N_RB_DL[MAX_NUM_CCs];
|
||||
lte_frame_type_t frame_type[MAX_NUM_CCs];
|
||||
uint32_t fdd_earfcn_DL[MAX_NUM_CCs];
|
||||
uint32_t fdd_earfcn_UL[MAX_NUM_CCs];
|
||||
int num_cc;
|
||||
|
||||
net_ip_address_t target_enb_x2_ip_address[X2AP_MAX_NB_ENB_IP_ADDRESS];
|
||||
uint8_t nb_x2;
|
||||
net_ip_address_t enb_x2_ip_address;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "x2ap_common.h"
|
||||
#include "x2ap_eNB_encoder.h"
|
||||
|
||||
int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
|
||||
{
|
||||
ssize_t encoded;
|
||||
|
||||
DevAssert(pdu != NULL);
|
||||
DevAssert(buffer != NULL);
|
||||
DevAssert(len != NULL);
|
||||
|
||||
if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu);
|
||||
}
|
||||
|
||||
encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, pdu, (void **)buffer);
|
||||
|
||||
if (encoded < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*len = encoded;
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_X2AP_PDU, pdu);
|
||||
return encoded;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef X2AP_ENB_ENCODER_H_
|
||||
#define X2AP_ENB_ENCODER_H_
|
||||
|
||||
int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
|
||||
__attribute__ ((warn_unused_result));
|
||||
|
||||
#endif /* X2AP_ENB_ENCODER_H_ */
|
||||
@@ -0,0 +1,405 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "x2ap_common.h"
|
||||
#include "x2ap_eNB.h"
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
#include "x2ap_eNB_encoder.h"
|
||||
|
||||
#include "x2ap_eNB_itti_messaging.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_request(
|
||||
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_X2SetupRequest_t *out;
|
||||
X2AP_X2SetupRequest_IEs_t *ie;
|
||||
X2AP_PLMN_Identity_t *plmn;
|
||||
ServedCells__Member *servedCellMember;
|
||||
X2AP_GU_Group_ID_t *gu;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = X2AP_ProcedureCode_id_x2Setup;
|
||||
pdu.choice.initiatingMessage.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.initiatingMessage.value.present = X2AP_InitiatingMessage__value_PR_X2SetupRequest;
|
||||
out = &pdu.choice.initiatingMessage.value.choice.X2SetupRequest;
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_X2SetupRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_GlobalENB_ID;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupRequest_IEs__value_PR_GlobalENB_ID;
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&ie->value.choice.GlobalENB_ID.pLMN_Identity);
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.present = X2AP_ENB_ID_PR_macro_eNB_ID;
|
||||
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
|
||||
&ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID);
|
||||
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0],
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1],
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_X2SetupRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_ServedCells;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupRequest_IEs__value_PR_ServedCells;
|
||||
{
|
||||
for (int i = 0; i<instance_p->num_cc; i++){
|
||||
servedCellMember = (ServedCells__Member *)calloc(1,sizeof(ServedCells__Member));
|
||||
{
|
||||
servedCellMember->servedCellInfo.pCI = instance_p->Nid_cell[i];
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&servedCellMember->servedCellInfo.cellId.pLMN_Identity);
|
||||
MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,0,
|
||||
&servedCellMember->servedCellInfo.cellId.eUTRANcellIdentifier);
|
||||
|
||||
INT16_TO_OCTET_STRING(instance_p->tac, &servedCellMember->servedCellInfo.tAC);
|
||||
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn);
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn);
|
||||
}
|
||||
|
||||
if (instance_p->frame_type[i] == FDD) {
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.present = X2AP_EUTRA_Mode_Info_PR_fDD;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_EARFCN = instance_p->fdd_earfcn_DL[i];
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_EARFCN = instance_p->fdd_earfcn_UL[i];
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
case 6:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
break;
|
||||
case 15:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw15;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw15;
|
||||
break;
|
||||
case 25:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw25;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw25;
|
||||
break;
|
||||
case 50:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw50;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw50;
|
||||
break;
|
||||
case 75:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw75;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw75;
|
||||
break;
|
||||
case 100:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw100;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw100;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,"Failed: Check value for N_RB_DL/N_RB_UL");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"X2Setuprequest not supported for TDD!");
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupRequest_IEs_t *)calloc(1, sizeof(X2AP_X2SetupRequest_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_GUGroupIDList;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupRequest_IEs__value_PR_GUGroupIDList;
|
||||
{
|
||||
gu = (X2AP_GU_Group_ID_t *)calloc(1, sizeof(X2AP_GU_Group_ID_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&gu->pLMN_Identity);
|
||||
//@TODO: consider to update this value
|
||||
INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode X2 setup request\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_eNB_data_p)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_X2SetupResponse_t *out;
|
||||
X2AP_X2SetupResponse_IEs_t *ie;
|
||||
X2AP_PLMN_Identity_t *plmn;
|
||||
ServedCells__Member *servedCellMember;
|
||||
X2AP_GU_Group_ID_t *gu;
|
||||
|
||||
x2ap_eNB_instance_t *instance_p;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
DevAssert(x2ap_eNB_data_p != NULL);
|
||||
|
||||
/* get the eNB instance */
|
||||
instance_p = x2ap_eNB_data_p->x2ap_eNB_instance;
|
||||
|
||||
DevAssert(instance_p != NULL);
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_x2Setup;
|
||||
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_X2SetupResponse;
|
||||
out = &pdu.choice.successfulOutcome.value.choice.X2SetupResponse;
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_X2SetupResponse_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_GlobalENB_ID;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupResponse_IEs__value_PR_GlobalENB_ID;
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&ie->value.choice.GlobalENB_ID.pLMN_Identity);
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.present = X2AP_ENB_ID_PR_macro_eNB_ID;
|
||||
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
|
||||
&ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID);
|
||||
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0],
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1],
|
||||
ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]);
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_X2SetupResponse_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_ServedCells;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupResponse_IEs__value_PR_ServedCells;
|
||||
{
|
||||
for (int i = 0; i<instance_p->num_cc; i++){
|
||||
servedCellMember = (ServedCells__Member *)calloc(1,sizeof(ServedCells__Member));
|
||||
{
|
||||
servedCellMember->servedCellInfo.pCI = instance_p->Nid_cell[i];
|
||||
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&servedCellMember->servedCellInfo.cellId.pLMN_Identity);
|
||||
MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,0,
|
||||
&servedCellMember->servedCellInfo.cellId.eUTRANcellIdentifier);
|
||||
|
||||
INT16_TO_OCTET_STRING(instance_p->tac, &servedCellMember->servedCellInfo.tAC);
|
||||
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn);
|
||||
ASN_SEQUENCE_ADD(&servedCellMember->servedCellInfo.broadcastPLMNs.list, plmn);
|
||||
}
|
||||
|
||||
if (instance_p->frame_type[i] == FDD) {
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.present = X2AP_EUTRA_Mode_Info_PR_fDD;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_EARFCN = instance_p->fdd_earfcn_DL[i];
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_EARFCN = instance_p->fdd_earfcn_UL[i];
|
||||
switch (instance_p->N_RB_DL[i]) {
|
||||
case 6:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw6;
|
||||
break;
|
||||
case 15:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw15;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw15;
|
||||
break;
|
||||
case 25:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw25;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw25;
|
||||
break;
|
||||
case 50:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw50;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw50;
|
||||
break;
|
||||
case 75:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw75;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw75;
|
||||
break;
|
||||
case 100:
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw100;
|
||||
servedCellMember->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = X2AP_Transmission_Bandwidth_bw100;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(0,"Failed: Check value for N_RB_DL/N_RB_UL");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
AssertFatal(0,"X2Setupresponse not supported for TDD!");
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.ServedCells.list, servedCellMember);
|
||||
}
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupResponse_IEs_t *)calloc(1, sizeof(X2AP_X2SetupResponse_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_GUGroupIDList;
|
||||
ie->criticality = X2AP_Criticality_reject;
|
||||
ie->value.present = X2AP_X2SetupResponse_IEs__value_PR_GUGroupIDList;
|
||||
{
|
||||
gu = (X2AP_GU_Group_ID_t *)calloc(1, sizeof(X2AP_GU_Group_ID_t));
|
||||
{
|
||||
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
|
||||
&gu->pLMN_Identity);
|
||||
//@TODO: consider to update this value
|
||||
INT16_TO_OCTET_STRING(0, &gu->mME_Group_ID);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&ie->value.choice.GUGroupIDList.list, gu);
|
||||
}
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode X2 setup response\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_READY;
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_failure(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
X2AP_Cause_PR cause_type,
|
||||
long cause_value,
|
||||
long time_to_wait)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
X2AP_X2SetupFailure_t *out;
|
||||
X2AP_X2SetupFailure_IEs_t *ie;
|
||||
|
||||
uint8_t *buffer;
|
||||
uint32_t len;
|
||||
int ret = 0;
|
||||
|
||||
/* Prepare the X2AP message to encode */
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
pdu.present = X2AP_X2AP_PDU_PR_unsuccessfulOutcome;
|
||||
pdu.choice.unsuccessfulOutcome.procedureCode = X2AP_ProcedureCode_id_x2Setup;
|
||||
pdu.choice.unsuccessfulOutcome.criticality = X2AP_Criticality_reject;
|
||||
pdu.choice.unsuccessfulOutcome.value.present = X2AP_UnsuccessfulOutcome__value_PR_X2SetupFailure;
|
||||
out = &pdu.choice.unsuccessfulOutcome.value.choice.X2SetupFailure;
|
||||
|
||||
/* mandatory */
|
||||
ie = (X2AP_X2SetupFailure_IEs_t *)calloc(1, sizeof(X2AP_X2SetupFailure_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_Cause;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_X2SetupFailure_IEs__value_PR_Cause;
|
||||
|
||||
x2ap_eNB_set_cause (&ie->value.choice.Cause, cause_type, cause_value);
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
/* optional: consider to handle this later */
|
||||
ie = (X2AP_X2SetupFailure_IEs_t *)calloc(1, sizeof(X2AP_X2SetupFailure_IEs_t));
|
||||
ie->id = X2AP_ProtocolIE_ID_id_TimeToWait;
|
||||
ie->criticality = X2AP_Criticality_ignore;
|
||||
ie->value.present = X2AP_X2SetupFailure_IEs__value_PR_TimeToWait;
|
||||
|
||||
if (time_to_wait > -1) {
|
||||
ie->value.choice.TimeToWait = time_to_wait;
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
|
||||
|
||||
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
|
||||
X2AP_ERROR("Failed to encode X2 setup failure\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB,
|
||||
MSC_X2AP_TARGET_ENB, NULL, 0,
|
||||
"0 X2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
|
||||
assoc_id, cause_type, cause_value);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p,
|
||||
X2AP_Cause_PR cause_type,
|
||||
long cause_value)
|
||||
{
|
||||
|
||||
DevAssert (cause_p != NULL);
|
||||
cause_p->present = cause_type;
|
||||
|
||||
switch (cause_type) {
|
||||
case X2AP_Cause_PR_radioNetwork:
|
||||
cause_p->choice.misc = cause_value;
|
||||
break;
|
||||
|
||||
case X2AP_Cause_PR_transport:
|
||||
cause_p->choice.misc = cause_value;
|
||||
break;
|
||||
|
||||
case X2AP_Cause_PR_protocol:
|
||||
cause_p->choice.misc = cause_value;
|
||||
break;
|
||||
|
||||
case X2AP_Cause_PR_misc:
|
||||
cause_p->choice.misc = cause_value;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef X2AP_ENB_GENERATE_MESSAGES_H_
|
||||
#define X2AP_ENB_GENERATE_MESSAGES_H_
|
||||
|
||||
#include "x2ap_eNB_defs.h"
|
||||
#include "x2ap_common.h"
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
|
||||
x2ap_eNB_data_t *x2ap_enb_data_p);
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data_t *x2ap_enb_data_p);
|
||||
|
||||
int x2ap_eNB_generate_x2_setup_failure(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
X2AP_Cause_PR cause_type,
|
||||
long cause_value,
|
||||
long time_to_wait);
|
||||
|
||||
int x2ap_eNB_set_cause (X2AP_Cause_t * cause_p,
|
||||
X2AP_Cause_PR cause_type,
|
||||
long cause_value);
|
||||
|
||||
#endif /* X2AP_ENB_GENERATE_MESSAGES_H_ */
|
||||
|
||||
@@ -27,12 +27,72 @@
|
||||
#include "x2ap_common.h"
|
||||
#include "x2ap_eNB_defs.h"
|
||||
#include "x2ap_eNB_handler.h"
|
||||
#include "x2ap_eNB_decoder.h"
|
||||
|
||||
#include "x2ap_eNB_management_procedures.h"
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_request (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_response (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_failure (instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu);
|
||||
|
||||
/* Handlers matrix. Only eNB related procedure present here */
|
||||
x2ap_message_decoded_callback x2ap_messages_callback[][3] = {
|
||||
{ 0, 0, 0 }, /* handoverPreparation */
|
||||
{ 0, 0, 0 }, /* handoverCancel */
|
||||
{ 0, 0, 0 }, /* loadIndication */
|
||||
{ 0, 0, 0 }, /* errorIndication */
|
||||
{ 0, 0, 0 }, /* snStatusTransfer */
|
||||
{ 0, 0, 0 }, /* uEContextRelease */
|
||||
{ x2ap_eNB_handle_x2_setup_request, x2ap_eNB_handle_x2_setup_response, x2ap_eNB_handle_x2_setup_failure }, /* x2Setup */
|
||||
{ 0, 0, 0 }, /* reset */
|
||||
{ 0, 0, 0 }, /* eNBConfigurationUpdate */
|
||||
{ 0, 0, 0 }, /* resourceStatusReportingInitiation */
|
||||
{ 0, 0, 0 }, /* resourceStatusReporting */
|
||||
{ 0, 0, 0 }, /* privateMessage */
|
||||
{ 0, 0, 0 }, /* mobilitySettingsChange */
|
||||
{ 0, 0, 0 }, /* rLFIndication */
|
||||
{ 0, 0, 0 }, /* handoverReport */
|
||||
{ 0, 0, 0 }, /* cellActivation */
|
||||
{ 0, 0, 0 }, /* x2Release */
|
||||
{ 0, 0, 0 }, /* x2APMessageTransfer */
|
||||
{ 0, 0, 0 }, /* x2Removal */
|
||||
{ 0, 0, 0 }, /* seNBAdditionPreparation */
|
||||
{ 0, 0, 0 }, /* seNBReconfigurationCompletion */
|
||||
{ 0, 0, 0 }, /* meNBinitiatedSeNBModificationPreparation */
|
||||
{ 0, 0, 0 }, /* seNBinitiatedSeNBModification */
|
||||
{ 0, 0, 0 }, /* meNBinitiatedSeNBRelease */
|
||||
{ 0, 0, 0 }, /* seNBinitiatedSeNBRelease */
|
||||
{ 0, 0, 0 }, /* seNBCounterCheck */
|
||||
{ 0, 0, 0 } /* retrieveUEContext */
|
||||
};
|
||||
|
||||
char *x2ap_direction2String(int x2ap_dir) {
|
||||
static char *x2ap_direction_String[] = {
|
||||
"", /* Nothing */
|
||||
"Originating message", /* originating message */
|
||||
"Successfull outcome", /* successfull outcome */
|
||||
"UnSuccessfull outcome", /* successfull outcome */
|
||||
};
|
||||
return(x2ap_direction_String[x2ap_dir]);
|
||||
}
|
||||
|
||||
void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *enb_desc_p, int sctp_shutdown)
|
||||
{
|
||||
if (sctp_shutdown) {
|
||||
@@ -77,3 +137,296 @@ void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *enb_desc_p, int sctp_shutdown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
const uint8_t *const data, const uint32_t data_length)
|
||||
{
|
||||
X2AP_X2AP_PDU_t pdu;
|
||||
int ret;
|
||||
|
||||
DevAssert(data != NULL);
|
||||
|
||||
memset(&pdu, 0, sizeof(pdu));
|
||||
|
||||
if (x2ap_eNB_decode_pdu(&pdu, data, data_length) < 0) {
|
||||
X2AP_ERROR("Failed to decode PDU\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Checking procedure Code and direction of message */
|
||||
if (pdu.choice.initiatingMessage.procedureCode > sizeof(x2ap_messages_callback) / (3 * sizeof(
|
||||
x2ap_message_decoded_callback))
|
||||
|| (pdu.present > X2AP_X2AP_PDU_PR_unsuccessfulOutcome)) {
|
||||
X2AP_ERROR("[SCTP %d] Either procedureCode %ld or direction %d exceed expected\n",
|
||||
assoc_id, pdu.choice.initiatingMessage.procedureCode, pdu.present);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_X2AP_PDU, &pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* No handler present.
|
||||
* This can mean not implemented or no procedure for eNB (wrong direction).
|
||||
*/
|
||||
if (x2ap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1] == NULL) {
|
||||
X2AP_ERROR("[SCTP %d] No handler for procedureCode %ld in %s\n",
|
||||
assoc_id, pdu.choice.initiatingMessage.procedureCode,
|
||||
x2ap_direction2String(pdu.present - 1));
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_X2AP_PDU, &pdu);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Calling the right handler */
|
||||
ret = (*x2ap_messages_callback[pdu.choice.initiatingMessage.procedureCode][pdu.present - 1])
|
||||
(instance, assoc_id, stream, &pdu);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_X2AP_X2AP_PDU, &pdu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
x2ap_eNB_handle_x2_setup_request(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_X2SetupRequest_t *x2SetupRequest;
|
||||
X2AP_X2SetupRequest_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
uint32_t eNB_id = 0;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2SetupRequest = &pdu->choice.initiatingMessage.value.choice.X2SetupRequest;
|
||||
|
||||
/*
|
||||
* We received a new valid X2 Setup Request on a stream != 0.
|
||||
* * * * This should not happen -> reject eNB x2 setup request.
|
||||
*/
|
||||
|
||||
if (stream != 0) {
|
||||
X2AP_ERROR("Received new x2 setup request on stream != 0\n");
|
||||
/*
|
||||
* Send a x2 setup failure with protocol cause unspecified
|
||||
*/
|
||||
return x2ap_eNB_generate_x2_setup_failure (instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Received a new X2 setup request\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupRequest_IEs_t, ie, x2SetupRequest,
|
||||
X2AP_ProtocolIE_ID_id_GlobalENB_ID, true);
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
|
||||
// Home eNB ID = 28 bits
|
||||
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 28) {
|
||||
//TODO: handle case were size != 28 -> notify ? reject ?
|
||||
}
|
||||
|
||||
eNB_id = (eNB_id_buf[0] << 20) + (eNB_id_buf[1] << 12) + (eNB_id_buf[2] << 4) + ((eNB_id_buf[3] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("Home eNB id: %07x\n", eNB_id);
|
||||
} else {
|
||||
// Macro eNB = 20 bits
|
||||
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf;
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 20) {
|
||||
//TODO: handle case were size != 20 -> notify ? reject ?
|
||||
}
|
||||
|
||||
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("macro eNB id: %05x\n", eNB_id);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
|
||||
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
|
||||
/*
|
||||
* eNB has not been found in list of associated eNB,
|
||||
* * * * Add it to the tail of list and initialize data
|
||||
*/
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
|
||||
/*
|
||||
* ??
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
x2ap_eNB_data->eNB_id = eNB_id;
|
||||
}
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
/*
|
||||
* eNB has been found in list, consider the x2 setup request as a reset connection,
|
||||
* * * * reseting any previous UE state if sctp association is != than the previous one
|
||||
*/
|
||||
if (x2ap_eNB_data->assoc_id != assoc_id) {
|
||||
/*
|
||||
* ??: Send an overload cause...
|
||||
*/
|
||||
X2AP_ERROR("Rejecting x2 setup request as eNB id %d is already associated to an active sctp association" "Previous known: %d, new one: %d\n", eNB_id, x2ap_eNB_data->assoc_id, assoc_id);
|
||||
|
||||
DevAssert(x2ap_eNB_data->x2ap_eNB_instance != NULL);
|
||||
x2ap_eNB_generate_x2_setup_failure (x2ap_eNB_data->x2ap_eNB_instance->instance,
|
||||
assoc_id,
|
||||
X2AP_Cause_PR_protocol,
|
||||
X2AP_CauseProtocol_unspecified,
|
||||
-1);
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
* TODO: call the reset procedure
|
||||
*/
|
||||
}
|
||||
|
||||
return x2ap_eNB_generate_x2_setup_response(x2ap_eNB_data);
|
||||
}
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_response(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_X2SetupResponse_t *x2SetupResponse;
|
||||
X2AP_X2SetupResponse_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
uint32_t eNB_id = 0;
|
||||
|
||||
DevAssert (pdu != NULL);
|
||||
x2SetupResponse = &pdu->choice.successfulOutcome.value.choice.X2SetupResponse;
|
||||
|
||||
/*
|
||||
* We received a new valid X2 Setup Response on a stream != 0.
|
||||
* * * * This should not happen -> reject eNB x2 setup response.
|
||||
*/
|
||||
|
||||
if (stream != 0) {
|
||||
X2AP_ERROR("Received new x2 setup response on stream != 0\n");
|
||||
}
|
||||
|
||||
if ((x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0)) == NULL) {
|
||||
X2AP_ERROR("[SCTP %d] Received X2 setup response for non existing "
|
||||
"eNB context\n", assoc_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Received a new X2 setup response\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupResponse_IEs_t, ie, x2SetupResponse,
|
||||
X2AP_ProtocolIE_ID_id_GlobalENB_ID, true);
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.present == X2AP_ENB_ID_PR_home_eNB_ID) {
|
||||
// Home eNB ID = 28 bits
|
||||
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 28) {
|
||||
//TODO: handle case were size != 28 -> notify ? reject ?
|
||||
}
|
||||
|
||||
eNB_id = (eNB_id_buf[0] << 20) + (eNB_id_buf[1] << 12) + (eNB_id_buf[2] << 4) + ((eNB_id_buf[3] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("Home eNB id: %07x\n", eNB_id);
|
||||
} else {
|
||||
// Macro eNB = 20 bits
|
||||
uint8_t *eNB_id_buf = ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.buf;
|
||||
|
||||
if (ie->value.choice.GlobalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 20) {
|
||||
//TODO: handle case were size != 20 -> notify ? reject ?
|
||||
}
|
||||
|
||||
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
|
||||
X2AP_DEBUG("macro eNB id: %05x\n", eNB_id);
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Adding eNB to the list of associated eNBs\n");
|
||||
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
|
||||
/*
|
||||
* eNB has not been found in list of associated eNB,
|
||||
* * * * Add it to the tail of list and initialize data
|
||||
*/
|
||||
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
|
||||
/*
|
||||
* ??: Send an overload cause...
|
||||
*/
|
||||
return -1;
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
x2ap_eNB_data->eNB_id = eNB_id;
|
||||
}
|
||||
} else {
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
|
||||
/*
|
||||
* TODO: call the reset procedure
|
||||
*/
|
||||
}
|
||||
|
||||
/* Optionaly set the target eNB name */
|
||||
|
||||
/* The association is now ready as source and target eNBs know parameters of each other.
|
||||
* Mark the association as connected.
|
||||
*/
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_READY;
|
||||
x2ap_eNB_data->x2ap_eNB_instance->x2_target_enb_associated_nb ++;
|
||||
x2ap_handle_x2_setup_message(x2ap_eNB_data, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int x2ap_eNB_handle_x2_setup_failure(instance_t instance,
|
||||
uint32_t assoc_id,
|
||||
uint32_t stream,
|
||||
X2AP_X2AP_PDU_t *pdu)
|
||||
{
|
||||
|
||||
X2AP_X2SetupFailure_t *x2SetupFailure;
|
||||
X2AP_X2SetupFailure_IEs_t *ie;
|
||||
|
||||
x2ap_eNB_data_t *x2ap_eNB_data;
|
||||
|
||||
DevAssert(pdu != NULL);
|
||||
|
||||
x2SetupFailure = &pdu->choice.unsuccessfulOutcome.value.choice.X2SetupFailure;
|
||||
|
||||
/*
|
||||
* We received a new valid X2 Setup Failure on a stream != 0.
|
||||
* * * * This should not happen -> reject eNB x2 setup failure.
|
||||
*/
|
||||
|
||||
if (stream != 0) {
|
||||
X2AP_WARN("[SCTP %d] Received x2 setup failure on stream != 0 (%d)\n",
|
||||
assoc_id, stream);
|
||||
}
|
||||
|
||||
if ((x2ap_eNB_data = x2ap_get_eNB (NULL, assoc_id, 0)) == NULL) {
|
||||
X2AP_ERROR("[SCTP %d] Received X2 setup failure for non existing "
|
||||
"eNB context\n", assoc_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
X2AP_DEBUG("Received a new X2 setup failure\n");
|
||||
|
||||
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupFailure_IEs_t, ie, x2SetupFailure,
|
||||
X2AP_ProtocolIE_ID_id_Cause, true);
|
||||
|
||||
|
||||
// need a FSM to handle all cases
|
||||
if ((ie->value.choice.Cause.present == X2AP_Cause_PR_misc) &&
|
||||
(ie->value.choice.Cause.choice.misc == X2AP_CauseMisc_unspecified)) {
|
||||
X2AP_WARN("Received X2 setup failure for eNB ... eNB is not ready\n");
|
||||
} else {
|
||||
X2AP_ERROR("Received x2 setup failure for eNB... please check your parameters\n");
|
||||
}
|
||||
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_WAITING;
|
||||
x2ap_handle_x2_setup_message(x2ap_eNB_data, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
|
||||
#include "x2ap_eNB_defs.h"
|
||||
|
||||
void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *mme_desc_p, int sctp_shutdown);
|
||||
void x2ap_handle_x2_setup_message(x2ap_eNB_data_t *eNB_desc_p, int sctp_shutdown);
|
||||
|
||||
//int x2ap_eNB_handle_message(uint32_t assoc_id, int32_t stream,
|
||||
// const uint8_t * const data, const uint32_t data_length);
|
||||
int x2ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
|
||||
const uint8_t * const data, const uint32_t data_length);
|
||||
|
||||
#endif /* X2AP_ENB_HANDLERS_H_ */
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
#include "x2ap_eNB_itti_messaging.h"
|
||||
|
||||
void x2ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
sctp_data_req_t *sctp_data_req;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_X2AP, SCTP_DATA_REQ);
|
||||
|
||||
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
|
||||
|
||||
sctp_data_req->assoc_id = assoc_id;
|
||||
sctp_data_req->buffer = buffer;
|
||||
sctp_data_req->buffer_length = buffer_length;
|
||||
sctp_data_req->stream = stream;
|
||||
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
|
||||
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id)
|
||||
{
|
||||
MessageDef *message_p = NULL;
|
||||
sctp_close_association_t *sctp_close_association_p = NULL;
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_X2AP, SCTP_CLOSE_ASSOCIATION);
|
||||
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
|
||||
sctp_close_association_p->assoc_id = assoc_id;
|
||||
|
||||
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef X2AP_ENB_ITTI_MESSAGING_H_
|
||||
#define X2AP_ENB_ITTI_MESSAGING_H_
|
||||
|
||||
void x2ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
|
||||
uint32_t buffer_length, uint16_t stream);
|
||||
|
||||
|
||||
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id);
|
||||
|
||||
|
||||
#endif /* X2AP_ENB_ITTI_MESSAGING_H_ */
|
||||
+42
-143
@@ -49,120 +49,13 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "gtpv1u_eNB_defs.h"
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
|
||||
#undef GTP_DUMP_SOCKET
|
||||
|
||||
/*
|
||||
extern boolean_t pdcp_data_req(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
unsigned char *const sdu_buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,const uint32_t * const sourceL2Id
|
||||
,const uint32_t * const destinationL2Id
|
||||
#endif
|
||||
);
|
||||
|
||||
const pdcp_transmission_mode_t modeP);
|
||||
*/
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
static int
|
||||
gtpv1u_eNB_send_init_udp(
|
||||
uint16_t port_number);
|
||||
|
||||
NwGtpv1uRcT
|
||||
gtpv1u_eNB_log_request(
|
||||
NwGtpv1uLogMgrHandleT hLogMgr,
|
||||
uint32_t logLevel,
|
||||
NwCharT *file,
|
||||
uint32_t line,
|
||||
NwCharT *logStr);
|
||||
|
||||
NwGtpv1uRcT
|
||||
gtpv1u_eNB_send_udp_msg(
|
||||
NwGtpv1uUdpHandleT udpHandle,
|
||||
uint8_t *buffer,
|
||||
uint32_t buffer_len,
|
||||
uint32_t buffer_offset,
|
||||
uint32_t peerIpAddr,
|
||||
uint16_t peerPort);
|
||||
|
||||
NwGtpv1uRcT
|
||||
gtpv1u_eNB_process_stack_req(
|
||||
NwGtpv1uUlpHandleT hUlp,
|
||||
NwGtpv1uUlpApiT *pUlpApi);
|
||||
|
||||
int
|
||||
data_recv_callback(
|
||||
uint16_t portP,
|
||||
uint32_t address,
|
||||
uint8_t *buffer,
|
||||
uint32_t length,
|
||||
void *arg_p);
|
||||
//int
|
||||
//gtpv1u_create_tunnel_endpoint(
|
||||
// gtpv1u_data_t *gtpv1u_data_pP,
|
||||
// uint8_t ue_idP,
|
||||
// uint8_t rab_idP,
|
||||
// char *sgw_ip_addr_pP,
|
||||
// uint16_t portP);
|
||||
static NwGtpv1uRcT
|
||||
gtpv1u_start_timer_wrapper(
|
||||
NwGtpv1uTimerMgrHandleT tmrMgrHandle,
|
||||
uint32_t timeoutSec,
|
||||
uint32_t timeoutUsec,
|
||||
uint32_t tmrType,
|
||||
void *timeoutArg,
|
||||
NwGtpv1uTimerHandleT *hTmr);
|
||||
|
||||
static NwGtpv1uRcT
|
||||
gtpv1u_stop_timer_wrapper(
|
||||
NwGtpv1uTimerMgrHandleT tmrMgrHandle,
|
||||
NwGtpv1uTimerHandleT hTmr);
|
||||
|
||||
int
|
||||
gtpv1u_initial_req(
|
||||
gtpv1u_data_t *gtpv1u_data_pP,
|
||||
teid_t teidP,
|
||||
tcp_udp_port_t portP,
|
||||
uint32_t address);
|
||||
|
||||
int
|
||||
gtpv1u_new_data_req(
|
||||
uint8_t enb_module_idP,
|
||||
rnti_t ue_rntiP,
|
||||
uint8_t rab_idP,
|
||||
uint8_t *buffer_pP,
|
||||
uint32_t buf_lenP,
|
||||
uint32_t buf_offsetP
|
||||
);
|
||||
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_create_tunnel_req_t * const create_tunnel_req_pP,
|
||||
gtpv1u_enb_create_tunnel_resp_t * const create_tunnel_resp_pP);
|
||||
|
||||
static int
|
||||
gtpv1u_delete_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_delete_tunnel_req_t * const req_pP);
|
||||
|
||||
static int
|
||||
gtpv1u_eNB_init(void);
|
||||
|
||||
void *
|
||||
gtpv1u_eNB_task(void *args);
|
||||
|
||||
//static gtpv1u_data_t gtpv1u_data_g;
|
||||
|
||||
#if defined(GTP_DUMP_SOCKET) && GTP_DUMP_SOCKET > 0
|
||||
#include <linux/if.h>
|
||||
static int gtpv1u_dump_socket_g;
|
||||
@@ -215,11 +108,11 @@ static void gtpv1u_eNB_write_dump_socket(uint8_t *buffer_pP, uint32_t buffer_len
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
|
||||
static int gtpv1u_eNB_send_init_udp(const Gtpv1uS1Req * req)
|
||||
{
|
||||
// Create and alloc new message
|
||||
MessageDef *message_p;
|
||||
struct in_addr addr;
|
||||
struct in_addr addr={0};
|
||||
|
||||
message_p = itti_alloc_new_message(TASK_GTPV1_U, UDP_INIT);
|
||||
|
||||
@@ -227,12 +120,10 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
|
||||
return -1;
|
||||
}
|
||||
|
||||
UDP_INIT(message_p).port = port_number;
|
||||
//LG UDP_INIT(message_p).address = "0.0.0.0"; //ANY address
|
||||
|
||||
addr.s_addr = RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up;
|
||||
UDP_INIT(message_p).port = req->enb_port_for_S1u_S12_S4_up;
|
||||
addr.s_addr = req->enb_ip_address_for_S1u_S12_S4_up;
|
||||
UDP_INIT(message_p).address = inet_ntoa(addr);
|
||||
LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up);
|
||||
LOG_I(GTPU, "Tx UDP_INIT IP addr %s (%x)\n", UDP_INIT(message_p).address,UDP_INIT(message_p).port);
|
||||
|
||||
MSC_LOG_EVENT(
|
||||
MSC_GTPU_ENB,
|
||||
@@ -242,6 +133,16 @@ static int gtpv1u_eNB_send_init_udp(uint16_t port_number)
|
||||
return itti_send_msg_to_task(TASK_UDP, INSTANCE_DEFAULT, message_p);
|
||||
}
|
||||
|
||||
static int gtpv1u_s1_req(
|
||||
const instance_t instanceP,
|
||||
const Gtpv1uS1Req * const req) {
|
||||
memcpy(&RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up,
|
||||
&req->enb_ip_address_for_S1u_S12_S4_up,
|
||||
sizeof (req->enb_ip_address_for_S1u_S12_S4_up));
|
||||
gtpv1u_eNB_send_init_udp(req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
NwGtpv1uRcT gtpv1u_eNB_log_request(NwGtpv1uLogMgrHandleT hLogMgr,
|
||||
uint32_t logLevel,
|
||||
@@ -999,23 +900,17 @@ static int gtpv1u_delete_s1u_tunnel(
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static int gtpv1u_eNB_init(void)
|
||||
int gtpv1u_eNB_init(void)
|
||||
{
|
||||
int ret;
|
||||
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
|
||||
NwGtpv1uUlpEntityT ulp;
|
||||
NwGtpv1uUdpEntityT udp;
|
||||
NwGtpv1uLogMgrEntityT log;
|
||||
NwGtpv1uTimerMgrEntityT tmr;
|
||||
|
||||
|
||||
// enb_properties_p = enb_config_get()->properties[0];
|
||||
RC.gtpv1u_data_g = (gtpv1u_data_t*)malloc(sizeof(gtpv1u_data_t));
|
||||
memset(RC.gtpv1u_data_g, 0, sizeof(gtpv1u_data_t));
|
||||
|
||||
RCconfig_gtpu();
|
||||
|
||||
|
||||
RC.gtpv1u_data_g = (gtpv1u_data_t*)calloc(sizeof(gtpv1u_data_t),1);
|
||||
|
||||
LOG_I(GTPU, "Initializing GTPU stack %p\n",&RC.gtpv1u_data_g);
|
||||
//gtpv1u_data_g.gtpv1u_stack;
|
||||
/* Initialize UE hashtable */
|
||||
@@ -1024,7 +919,6 @@ static int gtpv1u_eNB_init(void)
|
||||
RC.gtpv1u_data_g->teid_mapping = hashtable_create (256, NULL, NULL);
|
||||
AssertFatal(RC.gtpv1u_data_g->teid_mapping != NULL, " ERROR Initializing TASK_GTPV1_U task interface: in hashtable_create\n");
|
||||
// RC.gtpv1u_data_g.enb_ip_address_for_S1u_S12_S4_up = enb_properties_p->enb_ipv4_address_for_S1U;
|
||||
RC.gtpv1u_data_g->ip_addr = NULL;
|
||||
|
||||
//gtpv1u_data_g.udp_data;
|
||||
RC.gtpv1u_data_g->seq_num = 0;
|
||||
@@ -1089,35 +983,21 @@ static int gtpv1u_eNB_init(void)
|
||||
}
|
||||
|
||||
#endif
|
||||
ret = gtpv1u_eNB_send_init_udp(RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up);
|
||||
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
LOG_D(GTPU, "Initializing GTPV1U interface for eNB: DONE\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void *gtpv1u_eNB_task(void *args)
|
||||
{
|
||||
int rc = 0;
|
||||
instance_t instance;
|
||||
//const char *msg_name_p;
|
||||
|
||||
rc = gtpv1u_eNB_init();
|
||||
AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
|
||||
itti_mark_task_ready(TASK_GTPV1_U);
|
||||
MSC_START_USE();
|
||||
|
||||
while(1) {
|
||||
void *gtpv1u_eNB_process_itti_msg(void *notUsed) {
|
||||
/* Trying to fetch a message from the message queue.
|
||||
* If the queue is empty, this function will block till a
|
||||
* message is sent to the task.
|
||||
*/
|
||||
instance_t instance;
|
||||
MessageDef *received_message_p = NULL;
|
||||
int rc = 0;
|
||||
|
||||
itti_receive_msg(TASK_GTPV1_U, &received_message_p);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_IN);
|
||||
DevAssert(received_message_p != NULL);
|
||||
@@ -1127,6 +1007,9 @@ void *gtpv1u_eNB_task(void *args)
|
||||
|
||||
switch (ITTI_MSG_ID(received_message_p)) {
|
||||
|
||||
case GTPV1U_ENB_S1_REQ:
|
||||
gtpv1u_s1_req(instance, &received_message_p->ittiMsg.gtpv1uS1Req);
|
||||
|
||||
case GTPV1U_ENB_DELETE_TUNNEL_REQ: {
|
||||
gtpv1u_delete_s1u_tunnel(instance, &received_message_p->ittiMsg.Gtpv1uDeleteTunnelReq);
|
||||
}
|
||||
@@ -1258,6 +1141,22 @@ void *gtpv1u_eNB_task(void *args)
|
||||
AssertFatal(rc == EXIT_SUCCESS, "Failed to free memory (%d)!\n", rc);
|
||||
received_message_p = NULL;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GTPV1U_ENB_TASK, VCD_FUNCTION_OUT);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void *gtpv1u_eNB_task(void *args)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
rc = gtpv1u_eNB_init();
|
||||
AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
|
||||
itti_mark_task_ready(TASK_GTPV1_U);
|
||||
MSC_START_USE();
|
||||
|
||||
while(1) {
|
||||
(void) gtpv1u_eNB_process_itti_msg (NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -97,8 +97,6 @@ typedef struct gtpv1u_data_s {
|
||||
//RB_HEAD(gtpv1u_ue_map, gtpv1u_ue_data_s) gtpv1u_ue_map_head;
|
||||
/* Local IP address to use */
|
||||
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
|
||||
char *ip_addr;
|
||||
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
|
||||
/* UDP internal data */
|
||||
//udp_data_t udp_data;
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ gtpv1u_new_data_req(
|
||||
uint32_t buf_len,
|
||||
uint32_t buf_offset);*/
|
||||
|
||||
int gtpv1u_eNB_init(void);
|
||||
void *gtpv1u_eNB_process_itti_msg(void*);
|
||||
void *gtpv1u_eNB_task(void *args);
|
||||
|
||||
int
|
||||
|
||||
@@ -286,19 +286,20 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
|
||||
void *s1ap_eNB_task(void *arg)
|
||||
void s1ap_eNB_init(void)
|
||||
{
|
||||
MessageDef *received_msg = NULL;
|
||||
int result;
|
||||
|
||||
S1AP_DEBUG("Starting S1AP layer\n");
|
||||
|
||||
s1ap_eNB_prepare_internal_data();
|
||||
|
||||
itti_mark_task_ready(TASK_S1AP);
|
||||
MSC_START_USE();
|
||||
}
|
||||
|
||||
while (1) {
|
||||
void *s1ap_eNB_process_itti_msg(void* notUsed)
|
||||
{
|
||||
MessageDef *received_msg = NULL;
|
||||
int result;
|
||||
itti_receive_msg(TASK_S1AP, &received_msg);
|
||||
|
||||
switch (ITTI_MSG_ID(received_msg)) {
|
||||
@@ -413,6 +414,16 @@ void *s1ap_eNB_task(void *arg)
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
|
||||
received_msg = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void *s1ap_eNB_task(void *arg)
|
||||
{
|
||||
s1ap_eNB_init();
|
||||
|
||||
while (1) {
|
||||
(void) s1ap_eNB_process_itti_msg(NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -39,6 +39,8 @@ extern s1ap_eNB_config_t s1ap_config;
|
||||
|
||||
#define EPC_MODE_ENABLED s1ap_config.mme_enabled
|
||||
|
||||
void *s1ap_eNB_process_itti_msg(void*);
|
||||
void s1ap_eNB_init(void);
|
||||
void *s1ap_eNB_task(void *arg);
|
||||
|
||||
uint32_t s1ap_generate_eNB_id(void);
|
||||
|
||||
@@ -1039,15 +1039,9 @@ sctp_eNB_flush_sockets(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void *sctp_eNB_task(void *arg)
|
||||
void sctp_eNB_init(void)
|
||||
{
|
||||
int nb_events;
|
||||
struct epoll_event *events;
|
||||
MessageDef *received_msg = NULL;
|
||||
int result;
|
||||
|
||||
SCTP_DEBUG("Starting SCTP layer\n");
|
||||
|
||||
STAILQ_INIT(&sctp_cnx_list);
|
||||
@@ -1055,7 +1049,16 @@ void *sctp_eNB_task(void *arg)
|
||||
itti_mark_task_ready(TASK_SCTP);
|
||||
MSC_START_USE();
|
||||
|
||||
while (1) {
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void *sctp_eNB_process_itti_msg(void *notUsed)
|
||||
{
|
||||
int nb_events;
|
||||
struct epoll_event *events;
|
||||
MessageDef *received_msg = NULL;
|
||||
int result;
|
||||
|
||||
itti_receive_msg(TASK_SCTP, &received_msg);
|
||||
|
||||
/* Check if there is a packet to handle */
|
||||
@@ -1142,6 +1145,17 @@ void *sctp_eNB_task(void *arg)
|
||||
nb_events = itti_get_events(TASK_SCTP, &events);
|
||||
/* Now handle notifications for other sockets */
|
||||
sctp_eNB_flush_sockets(events, nb_events);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void *sctp_eNB_task(void *arg)
|
||||
{
|
||||
sctp_eNB_init();
|
||||
|
||||
while (1) {
|
||||
(void) sctp_eNB_process_itti_msg(NULL);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#ifndef SCTP_ENB_TASK_H_
|
||||
#define SCTP_ENB_TASK_H_
|
||||
|
||||
void sctp_eNB_init(void);
|
||||
void *sctp_eNB_process_itti_msg(void *);
|
||||
void *sctp_eNB_task(void *arg);
|
||||
|
||||
#endif /* SCTP_ENB_TASK_H_ */
|
||||
|
||||
@@ -44,6 +44,7 @@ typedef struct {
|
||||
int sock;
|
||||
int samples_per_subframe;
|
||||
uint64_t timestamp;
|
||||
uint64_t next_tx_timestamp;
|
||||
int is_enb;
|
||||
} tcp_bridge_state_t;
|
||||
|
||||
@@ -141,11 +142,27 @@ int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void
|
||||
{
|
||||
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
/* deal with discontinuities in output (think: eNB in TDD mode) */
|
||||
if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) {
|
||||
uint32_t b[4096];
|
||||
uint64_t to_send = timestamp - t->next_tx_timestamp;
|
||||
memset(b, 0, 4096 * sizeof(uint32_t));
|
||||
while (to_send) {
|
||||
int len = to_send > 4096 ? 4096 : to_send;
|
||||
int n = fullwrite(t->sock, b, len * 4);
|
||||
if (n != len * 4) {
|
||||
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
to_send -= len;
|
||||
}
|
||||
}
|
||||
int n = fullwrite(t->sock, buff[0], nsamps * 4);
|
||||
if (n != nsamps * 4) {
|
||||
printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
t->next_tx_timestamp = timestamp + nsamps;
|
||||
return nsamps;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,15 @@ eNBs =
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="debug";
|
||||
|
||||
@@ -156,6 +156,15 @@ eNBs =
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="debug";
|
||||
|
||||
@@ -193,6 +193,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -235,6 +235,15 @@ NETWORK_CONTROLLER :
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
/*
|
||||
log_config :
|
||||
{
|
||||
|
||||
@@ -225,6 +225,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -238,6 +238,15 @@ NETWORK_CONTROLLER :
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -192,6 +192,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -199,6 +199,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
|
||||
@@ -182,6 +182,15 @@ MACRLCs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="debug";
|
||||
|
||||
@@ -210,6 +210,15 @@ MACRLCs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config =
|
||||
{
|
||||
global_log_level ="info";
|
||||
|
||||
@@ -198,6 +198,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
|
||||
@@ -197,6 +197,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
|
||||
@@ -17,6 +17,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
|
||||
@@ -18,6 +18,15 @@ RUs = (
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config = {
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
|
||||
+14
-13
@@ -151,7 +151,8 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
|
||||
#endif
|
||||
extern int codingw;
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
|
||||
extern uint8_t nfapi_mode;
|
||||
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
|
||||
@@ -223,7 +224,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
|
||||
|
||||
if(!eNB->single_thread_flag && get_nprocs() >= 8){
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT){
|
||||
if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) {
|
||||
LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
|
||||
return(-1);
|
||||
@@ -245,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
/* CONFLICT RESOLUTION: BEGIN */
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
|
||||
if(oai_exit) return(-1);
|
||||
if(eNB->single_thread_flag || get_nprocs() <= 4){
|
||||
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD){
|
||||
#ifndef PHY_TX_THREAD
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
#endif
|
||||
@@ -421,8 +422,8 @@ static void* eNB_thread_rxtx( void* param ) {
|
||||
}
|
||||
pthread_mutex_unlock( &proc->mutex_rxtx );
|
||||
if (nfapi_mode!=2){
|
||||
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc);
|
||||
else
|
||||
if(get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) wakeup_tx(eNB,eNB->proc.ru_proc);
|
||||
else if(get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT)
|
||||
{
|
||||
phy_procedures_eNB_TX(eNB, proc, 1);
|
||||
wakeup_txfh(proc,eNB->proc.ru_proc);
|
||||
@@ -881,7 +882,7 @@ static void* process_stats_thread(void* param) {
|
||||
|
||||
void init_eNB_proc(int inst) {
|
||||
|
||||
int i=0;
|
||||
/*int i=0;*/
|
||||
int CC_id;
|
||||
PHY_VARS_eNB *eNB;
|
||||
eNB_proc_t *proc;
|
||||
@@ -953,7 +954,7 @@ void init_eNB_proc(int inst) {
|
||||
// attr_te = &proc->attr_te;
|
||||
#endif
|
||||
|
||||
if(get_nprocs() > 2 && codingw)
|
||||
if(get_thread_worker_conf() == WORKER_ENABLE)
|
||||
{
|
||||
init_te_thread(eNB);
|
||||
init_td_thread(eNB);
|
||||
@@ -962,7 +963,7 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
|
||||
|
||||
if (eNB->single_thread_flag==0 && nfapi_mode!=2) {
|
||||
if ((get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) && nfapi_mode!=2) {
|
||||
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
|
||||
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
|
||||
}
|
||||
@@ -970,13 +971,13 @@ void init_eNB_proc(int inst) {
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
pthread_create( &proc->pthread_prach_br, attr_prach_br, eNB_thread_prach_br, eNB );
|
||||
#endif
|
||||
char name[16];
|
||||
/*char name[16];
|
||||
if (eNB->single_thread_flag==0) {
|
||||
snprintf( name, sizeof(name), "RXTX0 %d", i );
|
||||
pthread_setname_np( proc_rxtx[0].pthread_rxtx, name );
|
||||
snprintf( name, sizeof(name), "RXTX1 %d", i );
|
||||
pthread_setname_np( proc_rxtx[1].pthread_rxtx, name );
|
||||
}
|
||||
}*/
|
||||
|
||||
AssertFatal(proc->instance_cnt_prach == -1,"instance_cnt_prach = %d\n",proc->instance_cnt_prach);
|
||||
|
||||
@@ -1029,7 +1030,7 @@ void kill_eNB_proc(int inst) {
|
||||
proc = &eNB->proc;
|
||||
proc_rxtx = &proc->proc_rxtx[0];
|
||||
|
||||
if(get_nprocs() > 2 && codingw) {
|
||||
if(get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
kill_td_thread(eNB);
|
||||
kill_te_thread(eNB);
|
||||
}
|
||||
@@ -1323,8 +1324,8 @@ void init_eNB(int single_thread_flag,int wait_for_sync) {
|
||||
#endif
|
||||
|
||||
|
||||
eNB->td = ulsch_decoding_data_all;//(get_nprocs()<=4) ? ulsch_decoding_data : ulsch_decoding_data_2thread;
|
||||
eNB->te = dlsch_encoding_all;//(get_nprocs()<=4) ? dlsch_encoding : dlsch_encoding_2threads;
|
||||
eNB->td = ulsch_decoding_data_all;
|
||||
eNB->te = dlsch_encoding_all;
|
||||
|
||||
|
||||
LOG_I(PHY,"Registering with MAC interface module\n");
|
||||
|
||||
+20
-14
@@ -119,10 +119,10 @@ static int DEFENBS[] = {0};
|
||||
extern volatile int oai_exit;
|
||||
extern int emulate_rf;
|
||||
extern int numerology;
|
||||
extern int fepw;
|
||||
extern int single_thread_flag;
|
||||
extern clock_source_t clock_source;
|
||||
|
||||
extern PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
extern WORKER_CONF_t get_thread_worker_conf(void);
|
||||
extern void phy_init_RU(RU_t*);
|
||||
extern void phy_free_RU(RU_t*);
|
||||
|
||||
@@ -1257,7 +1257,7 @@ void wakeup_eNBs(RU_t *ru) {
|
||||
LOG_D(PHY,"wakeup_eNBs (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
|
||||
|
||||
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && (get_nprocs() <= 4 || single_thread_flag)) {
|
||||
if (ru->num_eNB==1 && ru->eNB_top!=0 && get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD) {
|
||||
// call eNB function directly
|
||||
|
||||
char string[20];
|
||||
@@ -1456,6 +1456,12 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624;
|
||||
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
|
||||
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
|
||||
#if BASIC_SIMULATOR
|
||||
/* this is required for the basic simulator in TDD mode
|
||||
* TODO: find a proper cleaner solution
|
||||
*/
|
||||
ru->N_TA_offset = 0;
|
||||
#endif
|
||||
}
|
||||
if (ru->openair0_cfg.mmapped_dma == 1) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
@@ -1782,7 +1788,7 @@ static void* ru_thread( void* param ) {
|
||||
if (ru->num_eNB>0) wakeup_eNBs(ru);
|
||||
|
||||
#ifndef PHY_TX_THREAD
|
||||
if(get_nprocs() <= 4 || ru->num_eNB==0 || single_thread_flag){
|
||||
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0){
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru);
|
||||
|
||||
@@ -2195,7 +2201,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
if(emulate_rf)
|
||||
pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void*)proc );
|
||||
|
||||
if (!single_thread_flag && get_nprocs() > 4)
|
||||
if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
|
||||
pthread_create( &proc->pthread_FH1, attr_FH1, ru_thread_tx, (void*)ru );
|
||||
|
||||
if (ru->function == NGFI_RRU_IF4p5) {
|
||||
@@ -2222,7 +2228,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
pthread_create( &proc->pthread_prach, attr_prach, ru_thread_prach, (void*)ru );
|
||||
}
|
||||
|
||||
if (get_nprocs()> 2 && fepw) {
|
||||
if (get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
init_fep_thread(ru,NULL);
|
||||
init_feptx_thread(ru,NULL);
|
||||
}
|
||||
@@ -2260,7 +2266,7 @@ void kill_RU_proc(RU_t *ru)
|
||||
pthread_cond_destroy( &proc->cond_rf_tx);
|
||||
#endif
|
||||
|
||||
if (get_nprocs() > 2 && fepw) {
|
||||
if (get_thread_worker_conf() == WORKER_ENABLE) {
|
||||
LOG_D(PHY, "killing FEP thread\n");
|
||||
kill_fep_thread(ru);
|
||||
LOG_D(PHY, "killing FEP TX thread\n");
|
||||
@@ -2309,7 +2315,7 @@ void kill_RU_proc(RU_t *ru)
|
||||
|
||||
LOG_D(PHY, "Joining pthread_FH\n");
|
||||
pthread_join(proc->pthread_FH, NULL);
|
||||
if (!single_thread_flag && get_nprocs() > 4) {
|
||||
if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) {
|
||||
LOG_D(PHY, "Joining pthread_FHTX\n");
|
||||
pthread_join(proc->pthread_FH1, NULL);
|
||||
}
|
||||
@@ -2583,8 +2589,8 @@ void set_function_spec_param(RU_t *ru)
|
||||
ru->fh_north_out = fh_if4p5_north_out; // send_IF4p5 on reception
|
||||
ru->fh_south_out = tx_rf; // send output to RF
|
||||
ru->fh_north_asynch_in = fh_if4p5_north_asynch_in; // TX packets come asynchronously
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full :ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full :ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft only (no precoding in RRU)
|
||||
ru->feptx_prec = NULL;
|
||||
ru->start_if = start_if; // need to start the if interface for if4p5
|
||||
ru->ifdevice.host_type = RRU_HOST;
|
||||
@@ -2605,8 +2611,8 @@ void set_function_spec_param(RU_t *ru)
|
||||
}
|
||||
else if (ru->function == eNodeB_3GPP) {
|
||||
ru->do_prach = 0; // no prach processing in RU
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full : ru_fep_full_2thread; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // this is fep with idft and precoding
|
||||
ru->feptx_prec = feptx_prec; // this is fep with idft and precoding
|
||||
ru->fh_north_in = NULL; // no incoming fronthaul from north
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
@@ -2634,9 +2640,9 @@ void set_function_spec_param(RU_t *ru)
|
||||
|
||||
case REMOTE_IF5: // the remote unit is IF5 RRU
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = (get_nprocs()<=2 || !fepw) ? fep_full : fep_full; // this is frequency-shift + DFTs
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_DISABLE) ? fep_full : fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_nprocs()<=2 || !fepw) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_DISABLE) ? feptx_ofdm : feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
|
||||
if (ru->if_timing == synch_to_other) {
|
||||
ru->fh_south_in = fh_slave_south_in; // synchronize to master
|
||||
ru->fh_south_out = fh_if5_mobipass_south_out; // use send_IF5 for mobipass
|
||||
|
||||
@@ -219,8 +219,31 @@ extern void init_eNB_afterRU(void);
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int codingw = 0;
|
||||
int fepw = 0;
|
||||
char *parallel_config = NULL;
|
||||
char *worker_config = NULL;
|
||||
|
||||
static THREAD_STRUCT thread_struct;
|
||||
void set_parallel_conf(char *parallel_conf)
|
||||
{
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf)
|
||||
{
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void)
|
||||
{
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void)
|
||||
{
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -321,7 +344,15 @@ void signal_handler(int sig) {
|
||||
#define KBLU "\x1B[34m"
|
||||
#define RESET "\033[0m"
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
void signal_handler_itti(int sig) {
|
||||
// Call exit function
|
||||
char msg[256];
|
||||
memset(msg, 0, 256);
|
||||
sprintf(msg, "caught signal %s\n", strsignal(sig));
|
||||
exit_function(__FILE__, __FUNCTION__, __LINE__, msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
void exit_function(const char* file, const char* function, const int line, const char* s)
|
||||
{
|
||||
@@ -546,6 +577,8 @@ static void get_options(unsigned int *start_msc) {
|
||||
RC.nb_nb_iot_rrc_inst=RC.nb_nb_iot_L1_inst=RC.nb_nb_iot_macrlc_inst=0;
|
||||
}
|
||||
}
|
||||
if(parallel_config != NULL) set_parallel_conf(parallel_config);
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
}
|
||||
|
||||
|
||||
@@ -954,6 +987,11 @@ int main( int argc, char **argv )
|
||||
signal(SIGINT, signal_handler);
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
signal(SIGINT, signal_handler_itti);
|
||||
signal(SIGTERM, signal_handler_itti);
|
||||
signal(SIGABRT, signal_handler_itti);
|
||||
#endif
|
||||
|
||||
check_clock();
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@
|
||||
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
|
||||
|
||||
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
|
||||
#define CONFIG_HLP_CODINGW "coding worker thread enable(disable by defult)\n"
|
||||
#define CONFIG_HLP_FEPW "FEP worker thread enabled(disable by defult)\n"
|
||||
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
|
||||
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
|
||||
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
|
||||
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
|
||||
@@ -186,9 +186,9 @@
|
||||
{"s" , CONFIG_HLP_SNR, 0, iptr:&snr_dB, defintval:25, TYPE_INT, 0}, \
|
||||
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&numerology, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
|
||||
{"codingw" , CONFIG_HLP_CODINGW, PARAMFLAG_BOOL, iptr:&codingw, defintval:0, TYPE_INT, 0}, \
|
||||
{"fepw" , CONFIG_HLP_FEPW, PARAMFLAG_BOOL, iptr:&fepw, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)¶llel_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define CONFIG_HLP_FLOG "Enable online log \n"
|
||||
@@ -279,6 +279,10 @@ PHY_VARS_UE* init_ue_vars(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag);
|
||||
void init_eNB_afterRU(void);
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void);
|
||||
WORKER_CONF_t get_thread_worker_conf(void);
|
||||
void set_parallel_conf(char *parallel_conf);
|
||||
void set_worker_conf(char *worker_conf);
|
||||
|
||||
extern int stop_L1L2(module_id_t enb_id);
|
||||
extern int restart_L1L2(module_id_t enb_id);
|
||||
|
||||
@@ -333,6 +333,13 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
|
||||
}
|
||||
else UE->N_TA_offset = 0;
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
/* this is required for the basic simulator in TDD mode
|
||||
* TODO: find a proper cleaner solution
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
#endif
|
||||
|
||||
if (simL1flag == 1) init_ue_devices(UE);
|
||||
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
|
||||
init_UE_threads(inst);
|
||||
|
||||
@@ -220,8 +220,31 @@ int transmission_mode=1;
|
||||
|
||||
int emulate_rf = 0;
|
||||
int numerology = 0;
|
||||
int codingw = 0;
|
||||
int fepw = 0;
|
||||
char *parallel_config = NULL;
|
||||
char *worker_config = NULL;
|
||||
|
||||
static THREAD_STRUCT thread_struct;
|
||||
void set_parallel_conf(char *parallel_conf)
|
||||
{
|
||||
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
|
||||
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
|
||||
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
|
||||
}
|
||||
void set_worker_conf(char *worker_conf)
|
||||
{
|
||||
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
|
||||
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
|
||||
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
|
||||
}
|
||||
PARALLEL_CONF_t get_thread_parallel_conf(void)
|
||||
{
|
||||
return thread_struct.parallel_conf;
|
||||
}
|
||||
WORKER_CONF_t get_thread_worker_conf(void)
|
||||
{
|
||||
return thread_struct.worker_conf;
|
||||
}
|
||||
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
eth_params_t *eth_params;
|
||||
@@ -583,6 +606,8 @@ static void get_options(unsigned int *start_msc) {
|
||||
if(nfapi_mode!=3)
|
||||
uecap_xer_in=1;
|
||||
} *//* UE with config file */
|
||||
if(parallel_config != NULL) set_parallel_conf(parallel_config);
|
||||
if(worker_config != NULL) set_worker_conf(worker_config);
|
||||
}
|
||||
|
||||
|
||||
@@ -800,6 +825,8 @@ int main( int argc, char **argv )
|
||||
for (int i=0;i<MAX_NUM_CCs;i++) tx_max_power[i]=23;
|
||||
get_options (&start_msc);
|
||||
|
||||
printf("~~~~~~~~~~~~~~~~~~~~successfully get the parallel config[%d], worker config [%d] \n", get_thread_parallel_conf(), get_thread_worker_conf());
|
||||
|
||||
|
||||
printf("Running with %d UE instances\n",NB_UE_INST);
|
||||
if (NB_UE_INST > 1 && simL1flag != 1) {
|
||||
|
||||
Reference in New Issue
Block a user