Commit 24e01ea2 authored by laurent's avatar laurent

merge develop

parents db85b231 3c85cd58
......@@ -543,11 +543,11 @@ class SSHConnection():
sys.exit('Insufficient Parameter')
ci_full_config_file = config_path + '/ci-' + config_file
rruCheck = False
result = re.search('rru|du', str(config_file))
result = re.search('rru|du.band', str(config_file))
if result is not None:
rruCheck = True
# do not reset board twice in IF4.5 case
result = re.search('rru|enb|du', str(config_file))
result = re.search('rru|enb|du.band', str(config_file))
if result is not None:
self.command('echo ' + self.eNBPassword + ' | sudo -S uhd_find_devices', '\$', 10)
result = re.search('type: b200', str(self.ssh.before))
......@@ -571,11 +571,12 @@ class SSHConnection():
self.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
self.command('echo ' + self.eNBPassword + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5)
self.command('echo ' + self.eNBPassword + ' | sudo -S -E daemon --inherit --unsafe --name=enb' + str(self.eNB_instance) + '_daemon --chdir=' + self.eNBSourceCodePath + '/cmake_targets -o ' + self.eNBSourceCodePath + '/cmake_targets/enb_' + self.testCase_id + '.log ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
if not rruCheck:
result = re.search('rcc|enb|cu.band', str(config_file))
if result is not None:
self.eNBLogFile = 'enb_' + self.testCase_id + '.log'
if extra_options != '':
self.eNBOptions = extra_options
result = re.search('rru|du', str(config_file))
result = re.search('rru|du.band', str(config_file))
if result is not None:
self.rruLogFile = 'enb_' + self.testCase_id + '.log'
time.sleep(6)
......@@ -2527,6 +2528,7 @@ class SSHConnection():
pdcpFailure = 0
ulschFailure = 0
cdrxActivationMessageCount = 0
dropNotEnoughRBs = 0
self.htmleNBFailureMsg = ''
for line in enb_log_file.readlines():
if self.rruOptions != '':
......@@ -2546,6 +2548,9 @@ class SSHConnection():
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Cc]ore [dD]ump', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('./lte_build_oai/build/lte-softmodem', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Aa]ssertion', str(line))
......@@ -2596,6 +2601,9 @@ class SSHConnection():
result = re.search('Canceled RA procedure for UE rnti', str(line))
if result is not None:
rachCanceledProcedure += 1
result = re.search('dropping, not enough RBs', str(line))
if result is not None:
dropNotEnoughRBs += 1
enb_log_file.close()
logging.debug(' File analysis completed')
if uciStatMsgCount > 0:
......@@ -2610,6 +2618,10 @@ class SSHConnection():
statMsg = 'eNB showed ' + str(ulschFailure) + ' "ULSCH in error in round" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmleNBFailureMsg += statMsg + '\n'
if dropNotEnoughRBs > 0:
statMsg = 'eNB showed ' + str(dropNotEnoughRBs) + ' "dropping, not enough RBs" message(s)'
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
self.htmleNBFailureMsg += statMsg + '\n'
if rrcSetupComplete > 0:
rrcMsg = 'eNB completed ' + str(rrcSetupComplete) + ' RRC Connection Setup(s)'
logging.debug('\u001B[1;30;43m ' + rrcMsg + ' \u001B[0m')
......@@ -2688,6 +2700,9 @@ class SSHConnection():
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Cc]ore [dD]ump', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('./lte-uesoftmodem', str(line))
if result is not None and not exitSignalReceived:
foundSegFault = True
result = re.search('[Aa]ssertion', str(line))
......@@ -2890,7 +2905,7 @@ class SSHConnection():
self.htmleNBFailureMsg = 'Could not copy eNB logfile to analyze it!'
self.CreateHtmlTestRow('N/A', 'KO', ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
return
logging.debug('\u001B[1m Analyzing eNB logfile \u001B[0m')
logging.debug('\u001B[1m Analyzing eNB logfile \u001B[0m ' + fileToAnalyze)
logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze)
if (logStatus < 0):
self.CreateHtmlTestRow('N/A', 'KO', logStatus)
......
......@@ -30,7 +30,7 @@
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201
050102
030102 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201
030103 000020 040301 040504 000021 040302 000001 000022 040303 000002 040504 000023 040401 040201 030201
050202
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
......@@ -113,13 +113,13 @@
<testCase id="030102">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
<desc>Initialize eNB (FDD/Band7/5MHz) for RRC Inactivity Timer testing -- no FlexRan Ctl</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
</testCase>
<testCase id="030103">
<class>Initialize_eNB</class>
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
<desc>Initialize eNB (FDD/Band7/5MHz) for RRC Inactivity Timer testing -- with FlexRan Ctl</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
</testCase>
......
......@@ -174,7 +174,7 @@ set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}"
)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D${MKVER}"
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER}"
)
......@@ -885,6 +885,7 @@ add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PHY/flexran_agent_phy.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc_internal.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP/flexran_agent_pdcp.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
......
......@@ -33,7 +33,9 @@
#define __PHY_DEFS_ENB__H__
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
......
......@@ -415,7 +415,7 @@ typedef struct {
/// nprach_CP_Length_r13, for the CP length(unit us) only 66.7 and 266.7 is implemented
uint16_t nprach_CP_Length;
/// The criterion for UEs to select a NPRACH resource. Up to 2 RSRP threshold values can be signalled. \vr{[1..2]}
struct rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
rsrp_ThresholdsNPrachInfoList *rsrp_ThresholdsPrachInfoList;
/// NPRACH Parameters List
NPRACH_List_NB_IoT_t nprach_ParametersList;
......
......@@ -282,8 +282,16 @@ typedef struct {
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
#define cmin(a,b) ((a<b) ? (a) : (b))
#ifdef __cplusplus
#ifdef min
#undef min
#undef max
#endif
#else
#define max(a,b) cmax(a,b)
#define min(a,b) cmin(a,b)
#endif
#ifndef malloc16
# ifdef __AVX2__
......
......@@ -39,6 +39,8 @@ MESSAGE_DEF(X2AP_REGISTER_ENB_CNF , MESSAGE_PRIORITY_MED, x2ap_reg
MESSAGE_DEF(X2AP_DEREGISTERED_ENB_IND , MESSAGE_PRIORITY_MED, x2ap_deregistered_enb_ind_t , x2ap_deregistered_enb_ind)
/* handover messages X2AP <-> RRC */
MESSAGE_DEF(X2AP_SETUP_REQ , MESSAGE_PRIORITY_MED, x2ap_setup_req_t , x2ap_setup_req)
MESSAGE_DEF(X2AP_SETUP_RESP , MESSAGE_PRIORITY_MED, x2ap_setup_resp_t , x2ap_setup_resp)
MESSAGE_DEF(X2AP_HANDOVER_REQ , MESSAGE_PRIORITY_MED, x2ap_handover_req_t , x2ap_handover_req)
MESSAGE_DEF(X2AP_HANDOVER_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_handover_req_ack_t , x2ap_handover_req_ack)
MESSAGE_DEF(X2AP_HANDOVER_CANCEL , MESSAGE_PRIORITY_MED, x2ap_handover_cancel_t , x2ap_handover_cancel)
......
......@@ -29,6 +29,8 @@
// Defines to access message fields.
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
......@@ -41,6 +43,16 @@
// eNB application layer -> X2AP messages
typedef struct x2ap_setup_req_s {
uint32_t Nid_cell[MAX_NUM_CCs];
int num_cc;
} x2ap_setup_req_t;
typedef struct x2ap_setup_resp_s {
uint32_t Nid_cell[MAX_NUM_CCs];
int num_cc;
} x2ap_setup_resp_t;
/* X2AP UE CONTEXT RELEASE */
typedef struct x2ap_ue_context_release_s {
/* used for X2AP->RRC in source and RRC->X2AP in target */
......
......@@ -826,7 +826,6 @@ int flexran_agent_mac_stats_reply(mid_t mod_id,
}
}
free(ue_report);
ue_report = NULL;
}
return -1;
......
......@@ -60,6 +60,11 @@ void flexran_trigger_rrc_measurements (mid_t mod_id, LTE_MeasResults_t *);
int flexran_agent_rrc_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_rrc_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* Statistic reply for GTP statistics which OAI stores also in the RRC layer.
* This might be moved to a separate GTP module in the future */
int flexran_agent_rrc_gtp_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_rrc_gtp_destroy_stats_reply(Protocol__FlexStatsReply *reply);
/* Fill the RRC part of a ue_config message */
void flexran_agent_fill_rrc_ue_config(mid_t mod_id, rnti_t rnti,
Protocol__FlexUeConfig *ue_conf);
......
/*
* 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 "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg) {
// Measurement info reconfiguration
if (trigg->meas_info) {
/* Set serving cell frequency offset */
if (trigg->meas_info->has_offset_freq_serving) {
if (flexran_set_rrc_ofp(mod_id, rnti, trigg->meas_info->offset_freq_serving) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell frequency offset\n");
return -1;
}
}
/* Set neighbouring cell frequency offset */
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
if (trigg->meas_info->n_cell_individual_offset > 0) {
/* Set the serving cell offset */
if (flexran_set_rrc_ocp(mod_id, rnti, trigg->meas_info->cell_individual_offset[0]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Serving cell offset\n");
return -1;
}
/* Set the neighbouring cell offset */
for (int i=0; i<(trigg->meas_info->n_cell_individual_offset-1); i++) {
if (flexran_set_rrc_ocn(mod_id, rnti, i, trigg->meas_info->cell_individual_offset[i+1]) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell offset\n");
return -1;
}
}
}
if (trigg->meas_info->has_offset_freq_neighbouring) {
if (flexran_set_rrc_ofn(mod_id, rnti, trigg->meas_info->offset_freq_neighbouring) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Neighbouring cell frequency offset\n");
return -1;
}
}
/* Set rsrp filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrp) {
if (flexran_set_filter_coeff_rsrp(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrp) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRP filter coefficient\n");
return -1;
}
}
/* Set rsrq filter coefficient */
if (trigg->meas_info->has_filter_coefficient_rsrq) {
if (flexran_set_filter_coeff_rsrq(mod_id, rnti, trigg->meas_info->filter_coefficient_rsrq) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set RSRQ filter coefficient\n");
return -1;
}
}
if (trigg->meas_info->event) {
/* Set Periodic event parameters */
if (trigg->meas_info->event->periodical) {
/* Set Periodic event maximum number of reported cells */
if (trigg->meas_info->event->periodical->has_max_report_cells) {
if (flexran_set_rrc_per_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->periodical->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set Periodic event max\n");
return -1;
}
}
}
/* Set A3 event parameters */
if (trigg->meas_info->event->a3) {
/* Set A3 event a3 offset */
if (trigg->meas_info->event->a3->has_a3_offset) {
if (flexran_set_rrc_a3_event_a3_offset(mod_id, rnti, trigg->meas_info->event->a3->a3_offset) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event offset\n");
return -1;
}
}
/* Set A3 event report on leave */
if (trigg->meas_info->event->a3->has_report_on_leave) {
if (flexran_set_rrc_a3_event_reportOnLeave(mod_id, rnti, trigg->meas_info->event->a3->report_on_leave) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event report on leave\n");
return -1;
}
}
/* Set A3 event hysteresis */
if (trigg->meas_info->event->a3->has_hysteresis) {
if (flexran_set_rrc_a3_event_hysteresis(mod_id, rnti, trigg->meas_info->event->a3->hysteresis) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event hysteresis\n");
return -1;
}
}
/* Set A3 event time to trigger */
if (trigg->meas_info->event->a3->has_time_to_trigger) {
if (flexran_set_rrc_a3_event_timeToTrigger(mod_id, rnti, trigg->meas_info->event->a3->time_to_trigger) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event time to trigger\n");
return -1;
}
}
/* Set A3 event maximum number of reported cells */
if (trigg->meas_info->event->a3->has_max_report_cells) {
if (flexran_set_rrc_a3_event_maxReportCells(mod_id, rnti, trigg->meas_info->event->a3->max_report_cells) < 0) {
LOG_E(FLEXRAN_AGENT, "Cannot set A3 event max report cells\n");
return -1;
}
}
}
}
}
return 0;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FLEXRAN_AGENT_RRC_INTERNAL_H_
#define FLEXRAN_AGENT_RRC_INTERNAL_H_
#include "flexran_agent_rrc_internal.h"
#include "flexran_agent_ran_api.h"
int update_rrc_reconfig(mid_t mod_id, rnti_t rnti, Protocol__FlexRrcTriggering *trigg);
#endif /*FLEXRAN_AGENT_RRC_INTERNAL_H_*/
......@@ -268,3 +268,71 @@ message flex_plmn {
optional uint32 mnc = 2;
optional uint32 mnc_length = 3;
}
//
// UE-related RRC configuration
message flex_measurement_info {
// arbitrary offset OFS, from TS
optional int64 offset_freq_serving = 1;
// arbitrary offset OFN
optional int64 offset_freq_neighbouring = 2;
// arbitrary offset OCS + OCN
repeated int64 cell_individual_offset = 3;
// Parameter k for exponential moving average calculation coefficient
// a = 1/2^(k/4) of all measured RSRPs
optional int64 filter_coefficient_rsrp = 4;
// Parameter k for RSRQ filtering
optional int64 filter_coefficient_rsrq = 5;
optional flex_measurement_event event = 6;
}
message flex_measurement_event {
optional flex_per_event periodical = 1;
optional flex_a1_event a1 = 2;
optional flex_a2_event a2 = 3;
optional flex_a3_event a3 = 4;
optional flex_a4_event a4 = 5;
optional flex_a5_event a5 = 6;
}
message flex_per_event {
optional int64 max_report_cells = 1;
}
message flex_a1_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a2_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a3_event {
optional int64 a3_offset = 1;
optional int32 report_on_leave = 2;
optional int64 hysteresis = 3;
optional int64 time_to_trigger = 4;
optional int64 max_report_cells = 5;
}
message flex_a4_event {
optional int64 threshold_rsrp = 1;
optional int64 hysteresis = 2;
optional int64 time_to_trigger = 3;
optional int64 max_report_cells = 4;
}
message flex_a5_event {
optional int64 threshold_rsrp_1 = 1;
optional int64 threshold_rsrp_2 = 2;
optional int64 hysteresis = 3;
optional int64 time_to_trigger = 4;
optional int64 max_report_cells = 5;
}
......@@ -45,6 +45,7 @@ message flex_cell_config {
repeated flex_plmn plmn_id = 40; // The PLMN cell id of this cell
optional flex_slice_config slice_config = 42;
optional bool x2_ho_net_control = 43;
}
message flex_slice_config {
......@@ -97,6 +98,8 @@ message flex_ue_config {
optional uint64 imsi = 30;
optional uint32 dl_slice_id = 31;
optional uint32 ul_slice_id = 32;
// Configuration about RRC measurements
optional flex_measurement_info info = 33;
}
message flex_lc_ue_config {
......
......@@ -7,7 +7,7 @@ import "time_common.proto";
import "config_messages.proto";
import "controller_commands.proto";
import "control_delegation.proto";
import "config_common.proto";
message flexran_message {
optional flexran_direction msg_dir = 100;
......@@ -32,6 +32,7 @@ message flexran_message {
flex_rrc_triggering rrc_triggering = 18;
flex_ul_mac_config ul_mac_config_msg = 19;
flex_disconnect disconnect_msg = 20;
flex_ho_command ho_command_msg = 21;
}
}
......@@ -188,7 +189,14 @@ message flex_ul_mac_config {
message flex_rrc_triggering {
optional flex_header header = 1;
optional string rrc_trigger = 2;
optional string rrc_trigger = 2;
optional flex_measurement_info meas_info = 3;
}
message flex_ho_command {
optional flex_header header = 1;
optional uint32 rnti = 2;
optional uint32 target_phy_cell_id = 3;
}
//
......
......@@ -34,6 +34,7 @@ enum flex_type {
//Controller command messages
FLPT_DL_MAC_CONFIG = 13;
FLPT_HO_COMMAND = 21;
// UE state change messages
FLPT_UE_STATE_CHANGE = 14;
......
......@@ -305,3 +305,15 @@ message flex_mac_sdus_dl {
optional uint32 sdu_length = 1;
optional uint32 lcid = 2;
}
//
// GTP stats
//
message flex_gtp_stats {
optional uint32 e_rab_id = 1;
optional uint32 teid_enb = 2;
optional string addr_enb = 3;
optional uint32 teid_sgw = 4;
optional string addr_sgw = 5;
}
......@@ -50,6 +50,7 @@ message flex_ue_stats_report {
optional flex_rrc_measurements rrc_measurements = 10;
optional flex_pdcp_stats pdcp_stats = 11;
optional flex_mac_stats mac_stats = 12;
repeated flex_gtp_stats gtp_stats = 13;
}
//
......@@ -89,6 +90,7 @@ enum flex_ue_stats_type {
FLUST_MAC_STATS = 128;
FLUST_PDCP_STATS = 1024;
FLUST_GTP_STATS = 2048;
FLUST_RRC_MEASUREMENTS = 65536;
// To be extended with more types of stats
......
This diff is collapsed.
......@@ -41,6 +41,7 @@
//#include "PHY/extern.h"
#include "common/utils/LOG/log.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_rrc_internal.h"
//#include "SCHED/defs.h"
#include "RRC/LTE/rrc_extern.h"
......@@ -804,27 +805,91 @@ error:
}
int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
protocol_ctxt_t ctxt;
int flexran_agent_rrc_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexRrcTriggering *triggering = input->rrc_triggering;
agent_reconf_rrc *reconf_param = malloc(sizeof(agent_reconf_rrc));
reconf_param->trigger_policy = triggering->rrc_trigger;
reconf_param->report_interval = 0;
reconf_param->report_amount = 0;
struct rrc_eNB_ue_context_s *ue_context_p = NULL;
RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[mod_id]->rrc_ue_head)) {
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, mod_id, ENB_FLAG_YES, ue_context_p->ue_context.rnti, flexran_get_current_frame(mod_id), flexran_get_current_subframe (mod_id), mod_id);
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt, ue_context_p, 0, reconf_param);
// Set the proper values using FlexRAN API (protected with mutex ?)
if (!flexran_agent_get_rrc_xface(mod_id)) {
LOG_E(FLEXRAN_AGENT, "%s(): no RRC present, aborting\n", __func__);
return -1;
}
int num_ue = flexran_get_rrc_num_ues(mod_id);
if (num_ue == 0)
return 0;
rnti_t rntis[num_ue];
flexran_get_rrc_rnti_list(mod_id, rntis, num_ue);
for (int i = 0; i < num_ue; i++) {
const rnti_t rnti = rntis[i];
const int error = update_rrc_reconfig(mod_id, rnti, triggering);
if (error < 0) {
LOG_E(FLEXRAN_AGENT, "Error in updating user %d\n", i);
continue;
}
// Call the proper wrapper in FlexRAN API
if (flexran_call_rrc_reconfiguration (mod_id, rnti) < 0) {
LOG_E(FLEXRAN_AGENT, "Error in reconfiguring user %d\n", i);
}
}
*msg = NULL;
return 0;
}
int flexran_agent_rrc_trigger_handover(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
Protocol__FlexranMessage *input = (Protocol__FlexranMessage *)params;
Protocol__FlexHoCommand *ho_command = input->ho_command_msg;
int rnti_found = 0;
// Set the proper values using FlexRAN API (protected with mutex ?)
if (!flexran_agent_get_rrc_xface(mod_id)) {
LOG_E(FLEXRAN_AGENT, "%s(): no RRC present, aborting\n", __func__);
return -1;
}
int num_ue = flexran_get_rrc_num_ues(mod_id);
if (num_ue == 0)
return 0;
if (!ho_command->has_rnti) {
LOG_E(FLEXRAN_AGENT, "%s(): no UE rnti is present, aborting\n", __func__);
return -1;
}
if (!ho_command->has_target_phy_cell_id) {
LOG_E(FLEXRAN_AGENT, "%s(): no target physical cell id is present, aborting\n", __func__);
return -1;
}
rnti_t rntis[num_ue];
flexran_get_rrc_rnti_list(mod_id, rntis, num_ue);
for (int i = 0; i < num_ue; i++) {
const rnti_t rnti = rntis[i];
if (ho_command->rnti == rnti) {
rnti_found = 1;
// Call the proper wrapper in FlexRAN API
if (flexran_call_rrc_trigger_handover(mod_id, ho_command->rnti, ho_command->target_phy_cell_id) < 0) {
LOG_E(FLEXRAN_AGENT, "Error in handovering user %d/RNTI %x\n", i, rnti);
}
break;
}
}
if (!rnti_found)
return -1;
*msg = NULL;
free(reconf_param);
reconf_param = NULL;
return 0;
}
int flexran_agent_destroy_rrc_reconfiguration(Protocol__FlexranMessage *msg) {
// TODO
return 0;
}
int flexran_agent_destroy_rrc_measurement(Protocol__FlexranMessage *msg) {
int flexran_agent_destroy_rrc_trigger_handover(Protocol__FlexranMessage *msg) {
// TODO
return 0;
}
......@@ -849,6 +914,12 @@ int flexran_agent_handle_enb_config_reply(mid_t mod_id, const void *params, Prot
// initiate_soft_restart(mod_id, enb_config->cell_config[0]);
}
if (flexran_agent_get_rrc_xface(mod_id) && enb_config->cell_config[0]->has_x2_ho_net_control) {
if (flexran_set_x2_ho_net_control(mod_id, enb_config->cell_config[0]->x2_ho_net_control) < 0) {
LOG_E(FLEXRAN_AGENT, "Error in configuring X2 handover controlled by network");
}
}
*msg = NULL;
return 0;
}
......
......@@ -137,9 +137,12 @@ int flexran_agent_reconfiguration(mid_t mod_id, const void *params, Protocol__Fl
int flexran_agent_destroy_agent_reconfiguration(Protocol__FlexranMessage *msg);
/* rrc triggering measurement message constructor and destructor */
int flexran_agent_rrc_measurement(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_destroy_rrc_measurement(Protocol__FlexranMessage *msg);
int flexran_agent_rrc_reconfiguration(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_destroy_rrc_reconfiguration(Protocol__FlexranMessage *msg);
/* rrc triggering handover command message constructor and destructor */
int flexran_agent_rrc_trigger_handover(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_destroy_rrc_trigger_handover(Protocol__FlexranMessage *msg);
/* FlexRAN protocol message dispatcher function */
Protocol__FlexranMessage* flexran_agent_handle_message (mid_t mod_id,
......
......@@ -55,7 +55,10 @@ flexran_agent_message_decoded_callback agent_messages_callback[][3] = {
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UE_STATE_CHANGE_MSG*/
{flexran_agent_control_delegation, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_CONTROL_DELEGATION_MSG*/
{flexran_agent_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_AGENT_RECONFIGURATION_MSG*/
{flexran_agent_rrc_measurement, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_RRC_TRIGGERING_MSG*/
{flexran_agent_rrc_reconfiguration, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_RRC_TRIGGERING_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_UL_MAC_CONFIG_MSG*/
{0, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_DISCONNECT_MSG*/
{flexran_agent_rrc_trigger_handover, 0, 0}, /*PROTOCOL__FLEXRAN_MESSAGE__MSG_HO_COMMAND_MSG*/
};
flexran_agent_message_destruction_callback message_destruction_callback[] = {
......@@ -508,7 +511,13 @@ int flexran_agent_stats_reply(mid_t enb_id, xid_t xid, const report_config_t *re
goto error;
}
/* GTP reply split, currently performed through RRC module */
if (flexran_agent_get_rrc_xface(enb_id)
&& flexran_agent_rrc_gtp_stats_reply(enb_id, report_config, ue_report, cell_report) < 0) {
err_code = PROTOCOL__FLEXRAN_ERR__MSG_BUILD;
goto error;
}
stats_reply_msg->cell_report = cell_report;
stats_reply_msg->ue_report = ue_report;
......
This diff is collapsed.
......@@ -63,7 +63,7 @@ sub_frame_t flexran_get_current_subframe(mid_t mod_id);
/*Return the frame and subframe number in compact 16-bit format.
Bits 0-3 subframe, rest for frame. Required by FlexRAN protocol*/
uint16_t flexran_get_sfn_sf(mid_t mod_id);
uint32_t flexran_get_sfn_sf(mid_t mod_id);
/* Return a future frame and subframe number that is ahead_of_time
subframes later in compact 16-bit format. Bits 0-3 subframe,
......@@ -498,6 +498,12 @@ uint32_t flexran_get_pdcp_rx_aiat_w(mid_t mod_id, uint16_t uid, lcid_t lcid);
uint32_t flexran_get_pdcp_rx_oo(mid_t mod_id, uint16_t uid, lcid_t lcid);
/*********************RRC**********************/
/* Call RRC Reconfiguration wrapper function */
int flexran_call_rrc_reconfiguration (mid_t mod_id, rnti_t rnti);
/* Call RRC to trigger handover wrapper function */
int flexran_call_rrc_trigger_handover (mid_t mod_id, rnti_t rnti, int target_cell_id);
/*Get primary cell measuremeant id flexRAN*/
LTE_MeasId_t flexran_get_rrc_pcell_measid(mid_t mod_id, rnti_t rnti);
......@@ -510,22 +516,107 @@ float flexran_get_rrc_pcell_rsrq(mid_t mod_id, rnti_t rnti);
/* Get RRC neighbouring measurement */
int flexran_get_rrc_num_ncell(mid_t mod_id, rnti_t rnti);
/* Get physical cell id */
/* Get neighbouring physical cell id */
long flexran_get_rrc_neigh_phy_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi */
int flexran_get_rrc_neigh_cgi(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi info cell id */
uint32_t flexran_get_rrc_neigh_cgi_cell_id(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi info tac */
uint32_t flexran_get_rrc_neigh_cgi_tac(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get the number of neighbouring cgi mnc */
int flexran_get_rrc_neigh_cgi_num_mnc(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get the number of neighbouring cgi mcc */
int flexran_get_rrc_neigh_cgi_num_mcc(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get neighbouring cgi mnc */
uint32_t flexran_get_rrc_neigh_cgi_mnc(mid_t mod_id, rnti_t rnti, long cell_id, int mnc_id);
/* Get neighbouring cgi mcc */
uint32_t flexran_get_rrc_neigh_cgi_mcc(mid_t mod_id, rnti_t rnti, long cell_id, int mcc_id);
/* Get RSRP of neighbouring Cell */
float flexran_get_rrc_neigh_rsrp(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get RSRQ of neighbouring Cell */
float flexran_get_rrc_neigh_rsrq(mid_t mod_id, rnti_t rnti, long cell_id);
/*Get MCC PLMN identity neighbouring Cell*/
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mcc(mid_t mod_id, rnti_t rnti, int cell_id); */
/* Get ofp offset */
long flexran_get_rrc_ofp(mid_t mod_id, rnti_t rnti);
/* Get ofn offset */
long flexran_get_rrc_ofn(mid_t mod_id, rnti_t rnti);
/* Get ocp offset */
long flexran_get_rrc_ocp(mid_t mod_id, rnti_t rnti);
/* Get ocn offset */
long flexran_get_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id);
/* Get Periodic Event max reported cells */
long flexran_get_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti);
/* Get A3 Event hysteresis */
long flexran_get_rrc_a3_event_hysteresis(mid_t mod_id, rnti_t rnti);
/* Get A3 Event time to trigger */
long flexran_get_rrc_a3_event_timeToTrigger(mid_t mod_id, rnti_t rnti);
/* Get A3 Event max reported cells */
long flexran_get_rrc_a3_event_maxReportCells(mid_t mod_id, rnti_t rnti);
/* Get A3 Event a3 offset */
long flexran_get_rrc_a3_event_a3_offset(mid_t mod_id, rnti_t rnti);
/* Get A3 Event report on leave */
int flexran_get_rrc_a3_event_reportOnLeave(mid_t mod_id, rnti_t rnti);
/* Get filter coefficient for rsrp */
long flexran_get_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti);
/*Get MNC PLMN identity neighbouring Cell*/
/* currently not implemented
int flexran_get_rrc_neigh_plmn_mnc(mid_t mod_id, mid_t ue_id, int cell_id); */
/* Get filter coefficient for rsrq */
long flexran_get_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti);
/* Set ofp offset */
int flexran_set_rrc_ofp(mid_t mod_id, rnti_t rnti, long offsetFreq);
/* Set ofn offset */
int flexran_set_rrc_ofn(mid_t mod_id, rnti_t rnti, long offsetFreq);
/* Set ocp offset */
int flexran_set_rrc_ocp(mid_t mod_id, rnti_t rnti, long cellIndividualOffset);
/* Set ocn offset */
int flexran_set_rrc_ocn(mid_t mod_id, rnti_t rnti, long cell_id, long cellIndividualOffset);
/* Set Periodic Event max reported cells */
int flexran_set_rrc_per_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
/* Set A3 Event hysteresis */
int flexran_set_rrc_a3_event_hysteresis(mid_t mod_id, rnti_t rnti, long hysteresis);
/* Set A3 Event time to trigger */
int flexran_set_rrc_a3_event_timeToTrigger(mid_t mod_id, rnti_t rnti, long timeToTrigger);
/* Set A3 Event max reported cells */
int flexran_set_rrc_a3_event_maxReportCells(mid_t mod_id, rnti_t rnti, long maxReportCells);
/* Set A3 Event a3 offset */
int flexran_set_rrc_a3_event_a3_offset(mid_t mod_id, rnti_t rnti, long a3_offset);
/* Set A3 Event report on leave */
int flexran_set_rrc_a3_event_reportOnLeave(mid_t mod_id, rnti_t rnti, int reportOnLeave);
/* Set filter coefficient for rsrp */
int flexran_set_filter_coeff_rsrp(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRP);
/* Set filter coefficient for rsrq */
int flexran_set_filter_coeff_rsrq(mid_t mod_id, rnti_t rnti, long filterCoefficientRSRQ);
/* Get number of PLMNs that is broadcasted in SIB1 */
uint8_t flexran_get_rrc_num_plmn_ids(mid_t mod_id);
......@@ -539,6 +630,27 @@ uint16_t flexran_get_rrc_mnc(mid_t mod_id, uint8_t index);
/* Get index'th MNC's digit length broadcasted in SIB1 */
uint8_t flexran_get_rrc_mnc_digit_length(mid_t mod_id, uint8_t index);
/* Get X2 handover controlled by network */
int flexran_get_x2_ho_net_control(mid_t mod_id);
/* Set X2 handover controlled by network */
int flexran_set_x2_ho_net_control(mid_t mod_id, int x2_ho_net_control);
/* Get number of adjacent cells via X2 interface */
int flexran_get_rrc_num_adj_cells(mid_t mod_id);
/* Get the number of E-RABs for UE */
int flexran_agent_rrc_gtp_num_e_rab(mid_t mod_id, rnti_t rnti);
/* Get the e-RAB ID for UE */
int flexran_agent_rrc_gtp_get_e_rab_id(mid_t mod_id, rnti_t rnti, int index);
/* Get the TEID at the eNB for UE */
int flexran_agent_rrc_gtp_get_teid_enb(mid_t mod_id, rnti_t rnti, int index);
/* Get the TEID at the SGW for UE */
int flexran_agent_rrc_gtp_get_teid_sgw(mid_t mod_id, rnti_t rnti, int index);
/************************** Slice configuration **************************/
/* Get the DL slice ID for a UE */
......
......@@ -1001,7 +1001,7 @@ void eNB_Config_Local_DRX(
{
UE_list_t *UE_list_mac = NULL;
int UE_id = -1;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
UE_list_mac = &(RC.mac[Mod_id]->UE_list);
......
......@@ -91,7 +91,7 @@ void schedule_SRS(module_id_t module_idP,
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &(eNB->UE_list);
nfapi_ul_config_request_body_t *ul_req = NULL;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
COMMON_channels_t *cc = eNB->common_channels;
LTE_SoundingRS_UL_ConfigCommon_t *soundingRS_UL_ConfigCommon = NULL;
struct LTE_SoundingRS_UL_ConfigDedicated *soundingRS_UL_ConfigDedicated = NULL;
......@@ -198,7 +198,7 @@ void schedule_CSI(module_id_t module_idP,
UE_list_t *UE_list = &eNB->UE_list;
COMMON_channels_t *cc = NULL;
nfapi_ul_config_request_body_t *ul_req = NULL;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
cc = &eNB->common_channels[CC_id];
......@@ -571,7 +571,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_list_t *UE_list = &(eNB->UE_list);
COMMON_channels_t *cc = eNB->common_channels;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
start_meas(&(eNB->eNB_scheduler));
......
......@@ -480,7 +480,7 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_STATS *eNB_UE_stats = NULL;
UE_TEMPLATE *ue_template = NULL;
eNB_STATS *eNB_stats = NULL;
RRC_release_ctrl *release_ctrl = NULL;
RRC_release_ctrl_t *release_ctrl = NULL;
DLSCH_PDU *dlsch_pdu = NULL;
RA_t *ra = NULL;
int sdu_length_total = 0;
......@@ -490,7 +490,7 @@ schedule_ue_spec(module_id_t module_idP,
int continue_flag = 0;
int32_t normalized_rx_power, target_rx_power;
int tpc = 1;
UE_sched_ctrl *ue_sched_ctrl;
UE_sched_ctrl_t *ue_sched_ctrl;
int mcs;
int i;
int min_rb_unit[NFAPI_CC_MAX];
......@@ -1688,7 +1688,7 @@ dlsch_scheduler_interslice_multiplexing(module_id_t Mod_id,
int nb_mac_CC = RC.nb_mac_CC[Mod_id];
UE_list_t *UE_list = &eNB->UE_list;
slice_info_t *sli = &eNB->slice_info;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
COMMON_channels_t *cc;
int N_RBG[NFAPI_CC_MAX];
int slice_sorted_list[MAX_NUM_SLICES];
......@@ -1914,7 +1914,7 @@ schedule_ue_spec_br(module_id_t module_idP,
COMMON_channels_t *cc = mac->common_channels;
UE_list_t *UE_list = &mac->UE_list;
UE_TEMPLATE *UE_template = NULL;
UE_sched_ctrl *ue_sched_ctl = NULL;
UE_sched_ctrl_t *ue_sched_ctl = NULL;
nfapi_dl_config_request_pdu_t *dl_config_pdu = NULL;
nfapi_ul_config_request_pdu_t *ul_config_pdu = NULL;
nfapi_tx_request_pdu_t *TX_req = NULL;
......
......@@ -179,7 +179,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = eNB->common_channels;
UE_list_t *UE_list = &eNB->UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
uint8_t CC_id;
int UE_id;
unsigned char round = 0;
......@@ -585,7 +585,7 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
// uint16_t r1=0;
uint8_t CC_id;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
// int rrc_status = RRC_IDLE;
COMMON_channels_t *cc;
#ifdef TM5
......@@ -596,7 +596,7 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
rnti_t rnti1, rnti2;
LTE_eNB_UE_stats *eNB_UE_stats1 = NULL;
LTE_eNB_UE_stats *eNB_UE_stats2 = NULL;
UE_sched_ctrl *ue_sched_ctl1, *ue_sched_ctl2;
UE_sched_ctrl_t *ue_sched_ctl1, *ue_sched_ctl2;
#endif
memset(rballoc_sub[0],0,(MAX_NUM_CCs)*(N_RBG_MAX)*sizeof(unsigned char));
memset(min_rb_unit,0,sizeof(min_rb_unit));
......@@ -828,7 +828,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
int32_t normalized_rx_power, target_rx_power;
int32_t tpc = 1;
static int32_t tpc_accumulated = 0;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
int mcs;
int i;
int min_rb_unit[MAX_NUM_CCs];
......@@ -1968,7 +1968,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
uint8_t ulsch_ue_max_num[MAX_NUM_CCs];
uint16_t saved_ulsch_dci[MAX_NUM_CCs];
rnti_t rnti;
UE_sched_ctrl *UE_sched_ctl = NULL;
UE_sched_ctrl_t *UE_sched_ctl = NULL;
uint8_t cc_id_flag[MAX_NUM_CCs];
uint8_t harq_pid = 0,round = 0;
UE_list_t *UE_list= &eNB->UE_list;
......@@ -2627,7 +2627,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
COMMON_channels_t *cc;
UE_list_t *UE_list=&eNB->UE_list;
UE_TEMPLATE *UE_template;
UE_sched_ctrl *UE_sched_ctrl;
UE_sched_ctrl_t *UE_sched_ctrl;
int sched_frame=frameP;
int rvidx_tab[4] = {0,2,3,1};
uint16_t ul_req_index;
......
......@@ -208,7 +208,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
COMMON_channels_t *cc = &mac->common_channels[0];
UE_list_t *UE_list=&mac->UE_list;
UE_TEMPLATE *UE_template;
UE_sched_ctrl *UE_sched_ctrl;
UE_sched_ctrl_t *UE_sched_ctrl;
int sched_frame=frameP;
int sched_subframe = (subframeP+4)%10;
uint16_t ul_req_index;
......
......@@ -1073,7 +1073,7 @@ get_dl_cqi_pmi_size_pusch(COMMON_channels_t *cc,
//------------------------------------------------------------------------------
uint8_t
get_rel8_dl_cqi_pmi_size(UE_sched_ctrl *sched_ctl,
get_rel8_dl_cqi_pmi_size(UE_sched_ctrl_t *sched_ctl,
int CC_idP,
COMMON_channels_t *cc,
uint8_t tmode,
......@@ -2182,7 +2182,7 @@ add_new_ue(module_id_t mod_idP,
#endif
memset((void *) &UE_list->UE_sched_ctrl[UE_id],
0,
sizeof(UE_sched_ctrl));
sizeof(UE_sched_ctrl_t));
memset((void *) &UE_list->eNB_UE_stats[cc_idP][UE_id],
0,
sizeof(eNB_UE_STATS));
......@@ -2520,7 +2520,7 @@ UE_is_to_be_scheduled(module_id_t module_idP,
//------------------------------------------------------------------------------
{
UE_TEMPLATE *UE_template = &RC.mac[module_idP]->UE_list.UE_template[CC_id][UE_id];
UE_sched_ctrl *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *UE_sched_ctl = &RC.mac[module_idP]->UE_list.UE_sched_ctrl[UE_id];
// do not schedule UE if UL is not working
if (UE_sched_ctl->ul_failure_timer > 0 || UE_sched_ctl->ul_out_of_sync > 0)
......@@ -3928,7 +3928,7 @@ extract_harq(module_id_t mod_idP,
{
eNB_MAC_INST *eNB = RC.mac[mod_idP];
UE_list_t *UE_list = &eNB->UE_list;
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
rnti_t rnti = UE_RNTI(mod_idP, UE_id);
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
nfapi_harq_indication_fdd_rel13_t *harq_indication_fdd;
......@@ -4573,7 +4573,7 @@ extract_pucch_csi(module_id_t mod_idP,
//------------------------------------------------------------------------------
{
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
int no_pmi;
uint8_t Ltab[6] = { 0, 2, 4, 4, 4, 4 };
......@@ -4685,7 +4685,7 @@ extract_pusch_csi(module_id_t mod_idP,
{
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
int Ntab[6] = { 0, 4, 7, 9, 10, 13 };
int Ntab_uesel[6] = { 0, 8, 13, 17, 19, 25 };
int Ltab_uesel[6] = { 0, 6, 9, 13, 15, 18 };
......@@ -4980,7 +4980,7 @@ cqi_indication(module_id_t mod_idP,
return;
}
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
if (UE_id >= 0) {
LOG_D(MAC,"%s() UE_id:%d channel:%d cqi:%d\n",
......@@ -5047,7 +5047,7 @@ SR_indication(module_id_t mod_idP,
T_INT(rntiP));
int UE_id = find_UE_id(mod_idP, rntiP);
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
UE_sched_ctrl *UE_scheduling_ctrl = NULL;
UE_sched_ctrl_t *UE_scheduling_ctrl = NULL;
if (UE_id != -1) {
UE_scheduling_ctrl = &(UE_list->UE_sched_ctrl[UE_id]);
......@@ -5178,7 +5178,7 @@ harq_indication(module_id_t mod_idP,
}
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
UE_sched_ctrl *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
COMMON_channels_t *cc = &RC.mac[mod_idP]->common_channels[CC_idP];
// extract HARQ Information
......
......@@ -121,7 +121,7 @@ rx_sdu(const module_id_t enb_mod_idP,
eNB_MAC_INST *mac = NULL;
UE_list_t *UE_list = NULL;
rrc_eNB_ue_context_t *ue_contextP = NULL;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
UE_TEMPLATE *UE_template_ptr = NULL;
/* Init */
......@@ -1340,7 +1340,7 @@ schedule_ulsch_rnti(module_id_t module_idP,
UE_list_t *UE_list = NULL;
slice_info_t *sli = NULL;
UE_TEMPLATE *UE_template_ptr = NULL;
UE_sched_ctrl *UE_sched_ctrl_ptr = NULL;
UE_sched_ctrl_t *UE_sched_ctrl_ptr = NULL;
int rvidx_tab[4] = {0, 2, 3, 1};
int first_rb_slice[NFAPI_CC_MAX];
int n_rb_ul_tab[NFAPI_CC_MAX];
......@@ -1954,7 +1954,7 @@ void schedule_ulsch_rnti_emtc(module_id_t module_idP,
COMMON_channels_t *cc = eNB->common_channels;
UE_list_t *UE_list = &(eNB->UE_list);
UE_TEMPLATE *UE_template = NULL;
UE_sched_ctrl *UE_sched_ctrl = NULL;
UE_sched_ctrl_t *UE_sched_ctrl = NULL;
if (sched_subframeP < subframeP) {
sched_frame++;
......
......@@ -1070,7 +1070,7 @@ typedef struct {
/// DRX UL retransmission timer, one per UL HARQ process
/* Not implemented yet */
/* End of C-DRX related timers */
} UE_sched_ctrl;
} UE_sched_ctrl_t;
/*! \brief eNB template for the Random access information */
typedef struct {
......@@ -1168,7 +1168,7 @@ typedef struct {
/// eNB to UE statistics
eNB_UE_STATS eNB_UE_stats[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
/// scheduling control info
UE_sched_ctrl UE_sched_ctrl[MAX_MOBILES_PER_ENB];
UE_sched_ctrl_t UE_sched_ctrl[MAX_MOBILES_PER_ENB];
int next[MAX_MOBILES_PER_ENB];
int head;
int next_ul[MAX_MOBILES_PER_ENB];
......@@ -1191,11 +1191,11 @@ typedef struct {
rnti_t rnti;
///remove UE context flag
boolean_t removeContextFlg;
} UE_free_ctrl;
} UE_free_ctrl_t;
/*! \brief REMOVE UE list used by eNB to order UEs/CC for deleting*/
typedef struct {
/// deleting control info
UE_free_ctrl UE_free_ctrl[NUMBER_OF_UE_MAX+1];
UE_free_ctrl_t UE_free_ctrl[NUMBER_OF_UE_MAX+1];
int num_UEs;
int head_freelist; ///the head position of the delete list
int tail_freelist; ///the tail position of the delete list
......@@ -1772,11 +1772,11 @@ typedef struct {
volatile uint8_t flag;
rnti_t rnti;
mui_t rrc_eNB_mui;
}RRC_release_ctrl;
}RRC_release_ctrl_t;
typedef struct {
uint16_t num_UEs;
RRC_release_ctrl RRC_release_ctrl[NUMBER_OF_UE_MAX];
RRC_release_ctrl_t RRC_release_ctrl[NUMBER_OF_UE_MAX];
} RRC_release_list_t;
typedef struct {
......
......@@ -1160,7 +1160,7 @@ void get_csi_params(COMMON_channels_t * cc,
struct LTE_CQI_ReportPeriodic *cqi_PMI_ConfigIndex,
uint16_t * Npd, uint16_t * N_OFFSET_CQI, int *H);
uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl * sched_ctl, int CC_idP,
uint8_t get_rel8_dl_cqi_pmi_size(UE_sched_ctrl_t * sched_ctl, int CC_idP,
COMMON_channels_t * cc, uint8_t tmode,
struct LTE_CQI_ReportPeriodic
*cqi_ReportPeriodic);
......
......@@ -505,7 +505,7 @@ void sort_UEs(module_id_t Mod_idP,
int list_size = 0;
struct sort_ue_dl_params params = {Mod_idP, frameP, subframeP, slice_idx};
UE_list_t *UE_list = &(RC.mac[Mod_idP]->UE_list);
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
......@@ -546,7 +546,7 @@ void dlsch_scheduler_pre_processor_partitioning(module_id_t Mod_id,
const uint8_t rbs_retx[NFAPI_CC_MAX]) {
int UE_id, CC_id, N_RB_DL, i;
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
uint16_t available_rbs;
for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
......@@ -590,7 +590,7 @@ void dlsch_scheduler_pre_processor_accounting(module_id_t Mod_id,
int ue_count_retx[NFAPI_CC_MAX];
//uint8_t ue_retx_flag[NFAPI_CC_MAX][MAX_MOBILES_PER_ENB];
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
COMMON_channels_t *cc;
// Reset
......@@ -1226,7 +1226,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
uint8_t (*MIMO_mode_indicator)[N_RBG_MAX] = sli->pre_processor_results[slice_idx].MIMO_mode_indicator;
UE_list_t *UE_list = &eNB->UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
// int rrc_status = RRC_IDLE;
#ifdef TM5
int harq_pid1 = 0;
......@@ -1236,7 +1236,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
rnti_t rnti1, rnti2;
LTE_eNB_UE_stats *eNB_UE_stats1 = NULL;
LTE_eNB_UE_stats *eNB_UE_stats2 = NULL;
UE_sched_ctrl *ue_sched_ctl1, *ue_sched_ctl2;
UE_sched_ctrl_t *ue_sched_ctl1, *ue_sched_ctl2;
#endif
// Initialize scheduling information for all active UEs
memset(&sli->pre_processor_results[slice_idx], 0, sizeof(sli->pre_processor_results[slice_idx]));
......@@ -1391,7 +1391,7 @@ dlsch_scheduler_pre_processor_reset(module_id_t module_idP,
uint8_t CC_id;
int i, j;
UE_list_t *UE_list;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
int N_RB_DL, RBGsize, RBGsize_last;
int N_RBG[NFAPI_CC_MAX];
#ifdef SF0_LIMIT
......@@ -1615,7 +1615,7 @@ dlsch_scheduler_pre_processor_allocate(module_id_t Mod_id,
int i;
int tm = get_tmode(Mod_id, CC_id, UE_id);
UE_list_t *UE_list = &RC.mac[Mod_id]->UE_list;
UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
int N_RB_DL = to_prb(RC.mac[Mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
for (i = 0; i < N_RBG; i++) {
......@@ -1685,7 +1685,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
UE_list_t *UE_list = &eNB->UE_list;
slice_info_t *sli = &eNB->slice_info;
UE_TEMPLATE *UE_template = 0;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
int N_RB_UL = 0;
uint16_t available_rbs, first_rb_offset;
rnti_t rntiTable[MAX_MOBILES_PER_ENB];
......@@ -1865,7 +1865,7 @@ assign_max_mcs_min_rb(module_id_t module_idP,
UE_list_t *UE_list = &eNB->UE_list;
slice_info_t *sli = &eNB->slice_info;
UE_TEMPLATE *UE_template;
UE_sched_ctrl *ue_sched_ctl;
UE_sched_ctrl_t *ue_sched_ctl;
int Ncp;
int N_RB_UL;
int first_rb_offset, available_rbs;
......@@ -2042,7 +2042,7 @@ void sort_ue_ul(module_id_t module_idP,
int list_size = 0;
struct sort_ue_ul_params params = { module_idP, sched_frameP, sched_subframeP };
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
UE_sched_ctrl *UE_scheduling_control = NULL;
UE_sched_ctrl_t *UE_scheduling_control = NULL;
for (int i = 0; i < MAX_MOBILES_PER_ENB; i++) {
......
......@@ -235,7 +235,7 @@ rlc_am_receive_process_control_pdu(
rlc_sn_t ack_sn = RLC_AM_NEXT_SN(rlc_pP->vt_a);
rlc_sn_t sn_cursor = rlc_pP->vt_a;
rlc_sn_t vt_a_new = rlc_pP->vt_a;
rlc_sn_t sn_data_cnf;
rlc_sn_t sn_data_cnf = (rlc_sn_t) 0;
rlc_sn_t nack_sn,prev_nack_sn;
sdu_size_t data_cnf_so_stop = 0x7FFF;
unsigned int nack_index;
......
......@@ -61,6 +61,8 @@
#define MAX_PAYLOAD 1024 /* maximum payload size*/
#define MAX_NUM_NEIGH_CELLs 6 /* maximum neighbouring cells number */
#define UE_STATE_NOTIFICATION_INTERVAL 50
#define IPV4_ADDR "%u.%u.%u.%u"
......@@ -477,6 +479,73 @@ typedef struct HANDOVER_INFO_s {
int x2_id; /* X2AP UE ID in the target eNB */
} HANDOVER_INFO;
typedef struct PER_EVENT_s {
long maxReportCells;
} PER_EVENT_t;
typedef struct A1_EVENT_s {
long threshold_RSRP;
long hysteresis;
long timeToTrigger;
long maxReportCells;
} A1_EVENT_t;
typedef struct A2_EVENT_s {
long threshold_RSRP;
long hysteresis;
long timeToTrigger;
long maxReportCells;
} A2_EVENT_t;
typedef struct A3_EVENT_s {
long a3_offset;
int reportOnLeave;
long hysteresis;
long timeToTrigger;
long maxReportCells;
} A3_EVENT_t;
typedef struct A4_EVENT_s {
long threshold_RSRP;
long hysteresis;
long timeToTrigger;
long maxReportCells;
} A4_EVENT_t;
typedef struct A5_EVENT_s {
long threshold_RSRP_1;
long threshold_RSRP_2;
long hysteresis;
long timeToTrigger;
long maxReportCells;
} A5_EVENT_t;
typedef struct EVENTS_s {
PER_EVENT_t *per_event;
A1_EVENT_t *a1_event;
A2_EVENT_t *a2_event;
A3_EVENT_t *a3_event;
A4_EVENT_t *a4_event;
A5_EVENT_t *a5_event;
} EVENTS_t;
typedef struct MEASUREMENT_INFO_s {
//TODO: Extend to multiple meas objects for OFP/OFN offsets
long offsetFreq;
//TODO: extend to multiple carriers for OCP/OCN offsets
long cellIndividualOffset[MAX_NUM_NEIGH_CELLs+1];
long filterCoefficientRSRP;
long filterCoefficientRSRQ;
EVENTS_t *events;
} MEASUREMENT_INFO;
#define RRC_HEADER_SIZE_MAX 64
#define RRC_BUFFER_SIZE_MAX 1024
typedef struct {
......@@ -559,6 +628,7 @@ typedef struct eNB_RRC_UE_s {
SRB_INFO_TABLE_ENTRY Srb2;
LTE_MeasConfig_t *measConfig;
HANDOVER_INFO *handover_info;
MEASUREMENT_INFO *measurement_info;
LTE_MeasResults_t *measResults;
LTE_MobilityControlInfo_t *mobilityInfo;
......@@ -756,6 +826,14 @@ typedef struct eNB_RRC_INST_s {
/// NR cell id
uint64_t nr_cellid;
// X2 handover controlled by network
int x2_ho_net_control;
// Neighborouring cells id
int num_neigh_cells;
int num_neigh_cells_cc[MAX_NUM_CCs];
uint32_t neigh_cells_id[MAX_NUM_NEIGH_CELLs][MAX_NUM_CCs];
// other RAN parameters
int srb1_timer_poll_retransmit;
int srb1_poll_pdu;
......
This diff is collapsed.
......@@ -306,8 +306,7 @@ void
flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP,
const uint8_t ho_state,
agent_reconf_rrc *trig_param
const uint8_t ho_state
);
void
rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ctxt_pP,
......@@ -357,6 +356,9 @@ void *rrc_enb_task(void *args_p);
\param void *args_p Pointer on arguments to start the task. */
void *rrc_ue_task(void *args_p);
void rrc_eNB_process_x2_setup_request(int mod_id, x2ap_setup_req_t *m);
void rrc_eNB_process_x2_setup_response(int mod_id, x2ap_setup_resp_t *m);
void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_req_t *m);
......@@ -610,6 +612,12 @@ rrc_eNB_generate_HandoverPreparationInformation(
//LTE_PhysCellId_t targetPhyId
);
int
flexran_rrc_eNB_trigger_handover (int mod_id,
const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *ue_context_pP,
int target_cell_id);
void
check_handovers(
protocol_ctxt_t *const ctxt_pP
......
......@@ -291,6 +291,7 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *x2ap_eNB_data;
MessageDef *msg;
uint32_t eNB_id = 0;
DevAssert (pdu != NULL);
......@@ -391,17 +392,25 @@ x2ap_eNB_handle_x2_setup_request(instance_t instance,
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
return -1;
}
msg = itti_alloc_new_message(TASK_X2AP, X2AP_SETUP_REQ);
X2AP_SETUP_REQ(msg).num_cc = ie->value.choice.ServedCells.list.count;
if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI;
X2AP_SETUP_REQ(msg).Nid_cell[i] = x2ap_eNB_data->Nid_cell[i];
}
}
instance_p = x2ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL);
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
}
......@@ -418,6 +427,7 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
x2ap_eNB_instance_t *instance_p;
x2ap_eNB_data_t *x2ap_eNB_data;
MessageDef *msg;
uint32_t eNB_id = 0;
DevAssert (pdu != NULL);
......@@ -500,11 +510,16 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
return -1;
}
msg = itti_alloc_new_message(TASK_X2AP, X2AP_SETUP_RESP);
X2AP_SETUP_RESP(msg).num_cc = ie->value.choice.ServedCells.list.count;
if (ie->value.choice.ServedCells.list.count > 0) {
x2ap_eNB_data->num_cc = ie->value.choice.ServedCells.list.count;
for (int i=0; i<ie->value.choice.ServedCells.list.count;i++) {
servedCellMember = (ServedCells__Member *)ie->value.choice.ServedCells.list.array[i];
x2ap_eNB_data->Nid_cell[i] = servedCellMember->servedCellInfo.pCI;
X2AP_SETUP_RESP(msg).Nid_cell[i] = x2ap_eNB_data->Nid_cell[i];
}
}
......@@ -521,6 +536,8 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
instance_p->x2_target_enb_associated_nb ++;
x2ap_handle_x2_setup_message(instance_p, x2ap_eNB_data, 0);
itti_send_msg_to_task(TASK_RRC_ENB, instance_p->instance, msg);
return 0;
}
......
......@@ -267,7 +267,7 @@ int nas_message_decrypt(
{
LOG_FUNC_IN;
emm_security_context_t *emm_security_context = (emm_security_context_t*)security;
emm_security_context_t *emm_security_context = NULL;
int bytes = length;
/* Decode the header */
......@@ -277,7 +277,8 @@ int nas_message_decrypt(
LOG_TRACE(DEBUG, "MESSAGE TOO SHORT");
LOG_FUNC_RETURN (TLV_DECODE_BUFFER_TOO_SHORT);
} else if (size > 1) {
if (emm_security_context) {
if (security) {
emm_security_context = (emm_security_context_t*)security;
#if defined(NAS_MME)
if (emm_security_context->ul_count.seq_num > header->sequence_number) {
......@@ -376,7 +377,7 @@ int nas_message_decode(
void *security)
{
LOG_FUNC_IN;
emm_security_context_t *emm_security_context = (emm_security_context_t*)security;
emm_security_context_t *emm_security_context = NULL;
int bytes;
/* Decode the header */
......@@ -385,7 +386,8 @@ int nas_message_decode(
if (size < 0) {
LOG_FUNC_RETURN (TLV_DECODE_BUFFER_TOO_SHORT);
} else if (size > 1) {
if (emm_security_context) {
if (security) {
emm_security_context = (emm_security_context_t*)security;
#if defined(NAS_MME)
if (emm_security_context->ul_count.seq_num > msg->header.sequence_number) {
......@@ -971,6 +973,8 @@ static int _nas_message_decrypt(
#else
direction = SECU_DIRECTION_DOWNLINK;
#endif
if (emm_security_context == NULL)
LOG_FUNC_RETURN (0);
switch (security_header_type) {
case SECURITY_HEADER_TYPE_NOT_PROTECTED:
......
......@@ -539,7 +539,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
*/
static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
usrp_state_t *s = (usrp_state_t *)device->priv;
int samples_received=0,i,j;
int samples_received=0;
int nsamps2; // aligned to upper 32 or 16 byte boundary
#if defined(USRP_REC_PLAY)
......@@ -760,12 +760,9 @@ int trx_usrp_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,
*/
int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *openair0_cfg) {
usrp_state_t *s = (usrp_state_t *)device->priv;
static int first_call=1;
static double rf_freq,diff;
uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0]);
rx_tune_req.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL;
rx_tune_req.rf_freq = openair0_cfg[0].rx_freq[0];
rf_freq=openair0_cfg[0].rx_freq[0];
s->usrp->set_rx_freq(rx_tune_req);
return(0);
}
......@@ -1248,7 +1245,7 @@ extern "C" {
openair0_cfg[0].iq_txshift = 4;//shift
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
for(int i=0; i<s->usrp->get_rx_num_channels(); i++) {
for(int i=0; i<((int) s->usrp->get_rx_num_channels()); i++) {
if (i<openair0_cfg[0].rx_num_channels) {
s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i);
......@@ -1268,7 +1265,7 @@ extern "C" {
LOG_D(PHY, "usrp->get_tx_num_channels() == %zd\n", s->usrp->get_tx_num_channels());
LOG_D(PHY, "openair0_cfg[0].tx_num_channels == %d\n", openair0_cfg[0].tx_num_channels);
for(int i=0; i<s->usrp->get_tx_num_channels(); i++) {
for(int i=0; i<((int) s->usrp->get_tx_num_channels()); i++) {
::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i);
if (i<openair0_cfg[0].tx_num_channels) {
......@@ -1310,10 +1307,10 @@ extern "C" {
s->tx_stream = s->usrp->get_tx_stream(stream_args_tx);
/* Setting TX/RX BW after streamers are created due to USRP calibration issue */
for(int i=0; i<s->usrp->get_tx_num_channels() && i<openair0_cfg[0].tx_num_channels; i++)
for(int i=0; i<((int) s->usrp->get_tx_num_channels()) && i<openair0_cfg[0].tx_num_channels; i++)
s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
for(int i=0; i<s->usrp->get_rx_num_channels() && i<openair0_cfg[0].rx_num_channels; i++)
for(int i=0; i<((int) s->usrp->get_rx_num_channels()) && i<openair0_cfg[0].rx_num_channels; i++)
s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
for (int i=0; i<openair0_cfg[0].rx_num_channels; i++) {
......
......@@ -98,4 +98,4 @@ Only the input noise can be changed on command line with -s parameter.
With path loss = 0 set "-s 5" to see a little noise
#Caveacts
Still issues in power control: txgain, rxgain are not used
\ No newline at end of file
Still issues in power control: txgain, rxgain are not used
......@@ -602,7 +602,6 @@ __attribute__((__visibility__("default")))
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
// to change the log level, use this on command line
// --log_config.hw_log_level debug
// (for phy layer, replace "hw" by "phy"
rfsimulator_state_t *rfsimulator = (rfsimulator_state_t *)calloc(sizeof(rfsimulator_state_t),1);
if ((rfsimulator->ip=getenv("RFSIMULATOR")) == NULL ) {
......
......@@ -125,8 +125,15 @@ int main(int argc, char *argv[]) {
fullwrite(serviceSock, &header, sizeof(header));
int dataSize=sizeof(sample_t)*header.size*header.nbAnt;
if (dataSize>bufSize)
buff=realloc(buff,dataSize);
if (dataSize>bufSize) {
void * new_buff = realloc(buff, dataSize);
if (new_buff == NULL) {
free(buff);
AssertFatal(1, "Could not reallocate");
} else {
buff = new_buff;
}
}
AssertFatal(read(fd,buff,dataSize) == dataSize, "");
fullwrite(serviceSock, buff, dataSize);
......
......@@ -458,7 +458,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
proc->subframe_rx = subframe_rx;
if (!oai_exit) {
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(ru_proc->frame_rx), T_INT(ru_proc->subframe_rx));
L1_proc->timestamp_tx = ru_proc->timestamp_rx + (sf_ahead*fp->samples_per_tti);
L1_proc->frame_rx = ru_proc->frame_rx;
L1_proc->subframe_rx = ru_proc->subframe_rx;
......@@ -508,9 +508,9 @@ int wakeup_txfh(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,int frame_tx,int subfram
if (((fp->frame_type == TDD) && (subframe_select(fp,proc->subframe_tx)==SF_UL))||
(eNB->RU_list[ru_id]->state == RU_SYNC)||
(eNB->RU_list[ru_id]->wait_cnt>0)){
AssertFatal((pthread_mutex_lock(&proc->mutex_RUs))==0, "mutex_lock returns %d\n",ret);
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RUs))==0, "mutex_lock returns %d\n",ret);
proc->instance_cnt_RUs = 0;
AssertFatal((pthread_mutex_unlock(&proc->mutex_RUs))==0, "mutex_unlock returns %d\n",ret);
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RUs))==0, "mutex_unlock returns %d\n",ret);
continue;//hacking only works when all RU_tx works on the same subframe #TODO: adding mask stuff
}
......
......@@ -34,6 +34,7 @@
#include "UTIL/OPT/opt.h"
#include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h"
#include <dlfcn.h>
static softmodem_params_t softmodem_params;
char *parallel_config=NULL;
char *worker_config=NULL;
......
......@@ -132,7 +132,6 @@ int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
int UE_scan = 1;
int UE_scan_carrier = 0;
runmode_t mode = normal_txrx;
FILE *input_fd=NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment