Commit b5b07b14 authored by Florian Kaltenberger's avatar Florian Kaltenberger

Merge branch 'develop' of https://gitlab.eurecom.fr/oai/openairinterface5g into develop

parents 2165944a bea35b07
......@@ -32,8 +32,8 @@ job1:
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log |cat `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log |cat `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
......@@ -12,10 +12,12 @@ Obj.# Case# Test# Description
01 01 11 Build lte-softmodem_noS1.EXMIMO.Rel10
01 01 12 Build lte-softmodem_noS1.BLADERF.Rel10
01 01 13 Build lte-softmodem_noS1.ETHERNET.Rel10
01 01 14 Build lte-softmodem_noS1.LMSSDR.Rel10
01 01 20 Build lte-softmodem.USRP.Rel10
01 01 21 Build lte-softmodem.EXMIMO.Rel10
01 01 22 Build lte-softmodem.BLADERF.Rel10
01 01 23 Build lte-softmodem.ETHERNET.Rel10
01 01 24 Build lte-softmodem.LMSSDR.Rel10
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
......@@ -24,7 +26,7 @@ Obj.# Case# Test# Description
01 01 40 Build RRH Gateway for USRP (Rel 10)
01 01 41 Build RRH Gateway for EXMIMO (Rel 10)
01 01 42 Build RRH Gateway for BLADERF (Rel 10)
01 01 43 Build RRH Gateway for LMSSDR (Rel 10)
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
......
......@@ -781,7 +781,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
task_eNB = task_eNB + 'echo eNB_traffic_exec PID = $! \n'
task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i any -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9 ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + ' ) > ' + logfile_tshark_eNB + ' 2>&1 & \n '
task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i lo -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9 ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + ' ) > ' + logfile_tshark_eNB + ' 2>&1 & \n '
task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
task_eNB = task_eNB + 'echo eNB_tshark_exec PID = $! \n'
#terminate the eNB test case after timeout_cmd seconds
......@@ -1005,7 +1005,21 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
run_result_string = ' RUN_'+str(run) + ' = PASS'
else:
run_result_string = ' RUN_'+str(run) + ' = FAIL'
#If there is assertion, we mark the test case as failure as most likely eNB crashed
cmd = "grep -ilr \"assertion\" " + logdir_local_testcase + " | cat "
cmd_out = subprocess.check_output ([cmd], shell=True)
if len(cmd_out) !=0 :
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Assert)'
#If there is thread busy error, we mark the test case as failure as most likely eNB crashed
cmd = "grep -ilr \"thread busy\" " + logdir_local_testcase + " | cat "
cmd_out = subprocess.check_output ([cmd], shell=True)
if len(cmd_out) !=0:
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
run_result_string = run_result_string + tput_run_string
test_result=test_result & run_result
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -147,7 +147,6 @@ clean_all_files() {
compilations() {
cd $OPENAIR_DIR/cmake_targets/$1/build
echo_info "Log file for compilation written in: $dlog/$2.$REL.txt"
set +e
{
rm -f $3
......
......@@ -60,7 +60,9 @@ function help()
echo_error " -f, --rf-config-file filename RF specific configuration file"
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -n, --T-no-wait don't wait for tracer, start immediately"
echo_error " -p, --T-port port use given port"
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
......@@ -188,7 +190,17 @@ function main()
exe_arguments="$exe_arguments -m $2"
shift 2;
;;
-V | --vcd)
-n | --T-no-wait)
echo "setting T tracer operation"
exe_arguments="$exe_arguments --T_nowait"
shift ;
;;
-p | --T-port)
echo "setting T tracer port"
exe_arguments="$exe_arguments --T_port $2"
shift 2;
;;
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
shift ;
......
......@@ -139,7 +139,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_add_view(input_signal_log, input_signal_view);
/* UE 0 PUSCH IQ data */
w = new_xy_plot(g, 55, 55, "PUSCH IQ", 50);
w = new_xy_plot(g, 55, 55, "PUSCH IQ [UE 0]", 50);
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, -1000, 1000, -1000, 1000);
l = new_iqlog(h, database, "ENB_PHY_PUSCH_IQ", "nb_rb",
......@@ -149,11 +149,10 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_set_filter(l,
filter_eq(
filter_evarg(database, "ENB_PHY_PUSCH_IQ", "UE_ID"),
filter_int(0)
));
filter_int(0)));
/* UE 0 estimated UL channel */
w = new_xy_plot(g, 256*2, 55, "UL estimated channel", 50);
w = new_xy_plot(g, 280, 55, "UL estimated channel [UE 0]", 50);
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, 0, 512*10, -10, 80);
l = new_framelog(h, database,
......@@ -165,12 +164,44 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
logger_set_filter(l,
filter_eq(
filter_evarg(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"),
filter_int(0)
));
filter_int(0)));
/* UE 0 PUCCH energy */
w = new_xy_plot(g, 128, 55, "PUCCH1 energy (SR) [UE 0]", 50);
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, 0, 1024*10, -10, 80);
l = new_ttilog(h, database,
"ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "threshold", 0);
v = new_view_tti(10, g, w, new_color(g, "#ff0000"));
logger_add_view(l, v);
logger_set_filter(l,
filter_eq(
filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
filter_int(0)));
l = new_ttilog(h, database,
"ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "energy", 1);
v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
logger_add_view(l, v);
logger_set_filter(l,
filter_eq(
filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
filter_int(0)));
/* UE 0 PUCCH IQ data */
w = new_xy_plot(g, 55, 55, "PUCCH IQ [UE 0]", 50);
widget_add_child(g, line, w, -1);
xy_plot_set_range(g, w, -100, 100, -100, 100);
l = new_iqdotlog(h, database, "ENB_PHY_PUCCH_1AB_IQ", "I", "Q");
v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE);
logger_add_view(l, v);
logger_set_filter(l,
filter_eq(
filter_evarg(database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"),
filter_int(0)));
/* downlink/uplink UE DCIs */
widget_add_child(g, top_container,
new_label(g,"DL/UL TICK/DCI/ACK/NACK "), -1);
new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
line = new_container(g, HORIZONTAL);
widget_add_child(g, top_container, line, -1);
timeline_plot = new_timeline(g, 512, 8, 5);
......@@ -220,7 +251,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
/* harq processes' ticktime view */
widget_add_child(g, top_container,
new_label(g,"DL/UL HARQ (x8) "), -1);
new_label(g,"DL/UL HARQ (x8) [UE 0]"), -1);
line = new_container(g, HORIZONTAL);
widget_add_child(g, top_container, line, -1);
timeline_plot = new_timeline(g, 512, 2*8+2, 3);
......@@ -491,6 +522,8 @@ int main(int n, char **v)
on_off(database, "ENB_PHY_ULSCH_UE_NACK", is_on, 1);
on_off(database, "ENB_MASTER_TICK", is_on, 1);
on_off(database, "ENB_PHY_PUSCH_IQ", is_on, 1);
on_off(database, "ENB_PHY_PUCCH_1_ENERGY", is_on, 1);
on_off(database, "ENB_PHY_PUCCH_1AB_IQ", is_on, 1);
on_off(database, "LEGACY_RRC_INFO", is_on, 1);
on_off(database, "LEGACY_RRC_ERROR", is_on, 1);
......
CC=gcc
CFLAGS=-Wall -g -pthread -I..
OBJS=logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o iqlog.o
OBJS=logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o iqlog.o \
iqdotlog.o
logger.a: $(OBJS)
ar cr logger.a $(OBJS)
......
#include "logger.h"
#include "logger_defs.h"
#include "handler.h"
#include "database.h"
#include "filter/filter.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct iqdotlog {
struct logger common;
void *database;
int i_arg;
int q_arg;
};
static void _event(void *p, event e)
{
struct iqdotlog *l = p;
int i;
float I, Q;
if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
return;
I = e.e[l->i_arg].i;
Q = e.e[l->q_arg].i;
for (i = 0; i < l->common.vsize; i++)
l->common.v[i]->append(l->common.v[i], &I, &Q, 1);
}
logger *new_iqdotlog(event_handler *h, void *database,
char *event_name, char *I, char *Q)
{
struct iqdotlog *ret;
int event_id;
database_event_format f;
int i;
ret = calloc(1, sizeof(struct iqdotlog)); if (ret == NULL) abort();
ret->common.event_name = strdup(event_name);
if (ret->common.event_name == NULL) abort();
ret->database = database;
event_id = event_id_from_name(database, event_name);
ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
f = get_format(database, event_id);
/* look for args */
ret->i_arg = -1;
ret->q_arg = -1;
for (i = 0; i < f.count; i++) {
if (!strcmp(f.name[i], I)) ret->i_arg = i;
if (!strcmp(f.name[i], Q)) ret->q_arg = i;
}
if (ret->i_arg == -1) {
printf("%s:%d: argument '%s' not found in event '%s'\n",
__FILE__, __LINE__, I, event_name);
abort();
}
if (ret->q_arg == -1) {
printf("%s:%d: argument '%s' not found in event '%s'\n",
__FILE__, __LINE__, Q, event_name);
abort();
}
if (strcmp(f.type[ret->i_arg], "int") != 0) {
printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
__FILE__, __LINE__, I);
abort();
}
if (strcmp(f.type[ret->q_arg], "int") != 0) {
printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
__FILE__, __LINE__, Q);
abort();
}
return ret;
}
......@@ -169,7 +169,7 @@ logger *new_iqlog(event_handler *h, void *database,
}
if (strcmp(f.type[ret->N_RB_UL_arg], "int") != 0) {
printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
__FILE__, __LINE__, nb_rb);
__FILE__, __LINE__, N_RB_UL);
abort();
}
if (strcmp(f.type[ret->symbols_per_tti_arg], "int") != 0) {
......
......@@ -16,6 +16,8 @@ logger *new_ticklog(void *event_handler, void *database,
logger *new_iqlog(void *event_handler, void *database,
char *event_name, char *nb_rb, char *N_RB_UL, char *symbols_per_tti,
char *buffer_varname);
logger *new_iqdotlog(void *event_handler, void *database,
char *event_name, char *I, char *Q);
void framelog_set_skip(logger *_this, int skip_delay);
void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9);
......
......@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include "database.h"
#include "utils.h"
#include "../T_defs.h"
......
......@@ -1126,12 +1126,8 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch[0]->harq_ids[subframe] = harq_pid;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE;
}
break;
......@@ -1265,9 +1261,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
// MCS and TBS don't change across HARQ rounds
......@@ -1635,19 +1628,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
}
// reset HARQ process if this is the first transmission
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE;
}
if (dlsch1_harq->round == 0) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
if (dlsch1_harq->round == 0)
dlsch1_harq->status = ACTIVE;
}
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
......@@ -2022,19 +2007,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
}
// reset HARQ process if this is the first transmission
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
if ((dlsch0->active==1) && (dlsch0_harq->round == 0))
dlsch0_harq->status = ACTIVE;
}
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
if ((dlsch1->active==1) && (dlsch1_harq->round == 0))
dlsch1_harq->status = ACTIVE;
}
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
......@@ -2174,23 +2151,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// check if either TB is disabled (see 36-213 V8.6 p. 26)
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
dlsch0_harq->status = DISABLED;
}
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
dlsch1_harq->status = DISABLED;
}
dlsch0_harq->Nl = 1;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......@@ -2355,17 +2325,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
dlsch0_harq->mcs = mcs1;
}
if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
dlsch1_harq->status = ACTIVE;
dlsch1_harq->mcs = mcs2;
}
......@@ -2529,9 +2493,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......@@ -2661,9 +2622,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......
......@@ -258,13 +258,6 @@ typedef struct {
uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH
LTE_DL_eNB_HARQ_t *harq_processes[8];
/// circular list of free harq PIDs (the oldest come first)
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
int harq_pid_freelist[10];
/// the head position of the free list (if list is free then head=tail)
int head_freelist;
/// the tail position of the free list
int tail_freelist;
/// Number of soft channel bits
uint32_t G;
/// Codebook index for this dlsch (0,1,2,3)
......
......@@ -156,9 +156,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq;
dlsch->head_freelist = 0;
dlsch->tail_freelist = 0;
for (i=0; i<Mdlharq; i++) {
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
......@@ -199,8 +196,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
msg("Can't get harq_p %d\n",i);
exit_flag=3;
}
put_harq_pid_in_freelist(dlsch, i);
}
if (exit_flag==0) {
......
......@@ -55,7 +55,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned int rx_offset;
void (*dft)(int16_t *,int16_t *, int);
int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) {
case 128:
......
......@@ -400,9 +400,6 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
......
......@@ -155,10 +155,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3);
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = subframe / 5;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = subframe % 5;
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
}
......@@ -233,10 +233,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0;
......@@ -266,10 +266,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
......@@ -304,10 +304,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0;
......@@ -338,10 +338,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3);
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rah = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
......@@ -375,10 +375,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3);
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0;
......@@ -409,10 +409,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3);
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rah = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
......@@ -451,13 +451,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = subframe / 5;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1 = openair_daq_vars.target_ue_dl_mcs;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2 = 0;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = subframe / 5;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2 = openair_daq_vars.target_ue_dl_mcs;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap = 0;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = subframe % 5;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->TPC = 0;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rballoc = openair_daq_vars.ue_dl_rb_alloc;
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rah = 0;
......@@ -473,13 +473,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
DLSCH_alloc_pdu1E.rv = 0;
DLSCH_alloc_pdu1E.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
DLSCH_alloc_pdu1E.ndi = subframe / 5;
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
phy_vars_eNB->eNB_UE_stats[0].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
DLSCH_alloc_pdu1E.harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
DLSCH_alloc_pdu1E.harq_pid = subframe % 5;
DLSCH_alloc_pdu1E.dai = 0;
DLSCH_alloc_pdu1E.TPC = 0;
DLSCH_alloc_pdu1E.rballoc = openair_daq_vars.ue_dl_rb_alloc;
......
......@@ -133,30 +133,6 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
return(0);
}
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
}
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
abort();
}
/* basic check, in case several threads deal with the free list at the same time
* in normal situations it should not happen, that's also why we don't use any
* locking mechanism to protect the free list
* to be refined in case things don't work properly
*/
if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
abort();
}
DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
}
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
{
uint8_t i;
......@@ -221,12 +197,6 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
// mac_exit_wrapper("Removing UE");
/* clear the harq pid freelist */
phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
for (j = 0; j < 8; j++)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
return(i);
}
}
......@@ -258,9 +228,8 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
LTE_eNB_DLSCH_t *DLSCH_ptr;
LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame;
uint8_t i;
int i;
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
......@@ -271,40 +240,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
if (ul_flag == 0) {// this is a DL request
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0];
// set to no available process first
*harq_pid = -1;
for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
if (DLSCH_ptr->harq_processes[i]!=NULL) {
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
if (sf2<=sf1)
sfdiff = sf1-sf2;
else // this happens when wrapping around 1024 frame barrier
sfdiff = 10240 + sf1-sf2;
LOG_D(PHY,"process %d is active, round %d (waiting %d)\n",i,DLSCH_ptr->harq_processes[i]->round,sfdiff);
if (sfdiff>sfdiff_max) { // this is an active process that is waiting longer than the others (and longer than 7 ms)
sfdiff_max = sfdiff;
*harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round;
}
}
} else { // a process is not defined
LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id);
return(-1);
}
}
/* let's go synchronous for the moment - maybe we can change at some point */
i = (frame * 10 + subframe) % 8;
/* if no active harq pid, get the oldest in the freelist, if any */
if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
*harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
*harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round;
} else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) {
*harq_pid = i;
*round = 0;
LOG_D(PHY,"process %d is first free process\n", *harq_pid);
} else {
printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
abort();
}
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
frame,subframe,*harq_pid);
} else { // This is a UL request
ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id];
......@@ -1906,7 +1854,6 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
}
} else {
......@@ -1923,7 +1870,6 @@ void process_HARQ_feedback(uint8_t UE_id,
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE
dlsch_harq_proc->round = 0;
dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
ue_stats->total_TBS = ue_stats->total_TBS +
......@@ -2345,9 +2291,6 @@ void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_
phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++;
if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
/* is this test necessary? */
if (phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status != SCH_IDLE)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[UE_id][0], 0);
phy_vars_eNB->first_sr[UE_id] = 0;
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0;
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE;
......
......@@ -298,6 +298,12 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
int UE_id = find_UE_id(mod_idP,rntiP);
int pCC_id = UE_PCCID(mod_idP,UE_id);
if (UE_id == -1) {
LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", rntiP);
mac_phy_remove_ue(mod_idP,rntiP);
return 0;
}
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP);
dump_ue_list(UE_list,0);
......
......@@ -719,12 +719,12 @@ mac_eNB_get_rrc_status(
}
}
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
const int CC_idP,
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
const int CC_idP,
const frame_t frameP,
const sub_frame_t subframeP,
const rnti_t rntiP) {
const rnti_t rntiP)
{
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
ue_context_p = rrc_eNB_get_ue_context(
&eNB_rrc_inst[Mod_instP],
......@@ -735,10 +735,9 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
ue_context_p->ue_context.ul_failure_timer=1;
}
else {
LOG_W(RRC,"Frame %d, Subframe %d: UE %x unknown \n",frameP,subframeP,rntiP);
rrc_mac_remove_ue(Mod_instP,rntiP);
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
}
rrc_mac_remove_ue(Mod_instP,rntiP);
}
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
......
......@@ -3799,14 +3799,29 @@ rrc_eNB_decode_ccch(
//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p);
stmsi_received=1;
/* replace rnti in the context */
/* for that, remove the context from the RB tree */
RB_REMOVE(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
/* and insert again, after changing rnti everywhere it has to be changed */
ue_context_p->ue_id_rnti = ctxt_pP->rnti;
ue_context_p->ue_context.rnti = ctxt_pP->rnti;
RB_INSERT(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
/* reset timers */
ue_context_p->ue_context.ul_failure_timer = 0;
ue_context_p->ue_context.ue_release_timer = 0;
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
// ue_context_p = NULL;
} else {
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE;
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
if (ue_context_p == NULL)
LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
if (ue_context_p != NULL) {
ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE;
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
} else {
break;
}
}
MSC_LOG_RX_MESSAGE(
......
......@@ -137,27 +137,15 @@ typedef guint8 gboolean;
//static unsigned char g_PDUBuffer[1600];
//static unsigned int g_PDUOffset;
#ifdef JUMBO_FRAME
static unsigned char g_frameBuffer[9000];
#else
static unsigned char g_frameBuffer[1600];
#endif
//static unsigned char g_fileBuffer[1600];
static unsigned int g_frameOffset;
char in_ip[40];
char in_path[100];
static uint16_t in_port;
FILE *file_fd = NULL;
trace_mode_t opt_type = OPT_NONE;
static radio_type_t radio_type;
static unsigned int subframesSinceCaptureStart;
// double timing_perf[250];
// clock_t timing_in[250];
// clock_t timing_out[250];
int test=0;
int init_value=0;
static int g_socksd = -1;/* UDP socket used for sending frames */
static struct sockaddr_in g_serv_addr;
......@@ -277,66 +265,73 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size)
{
#ifdef JUMBO_FRAME
static unsigned char frameBuffer[9000];
#else
static unsigned char frameBuffer[1600];
#endif
static unsigned int frameOffset;
ssize_t bytesSent;
g_frameOffset = 0;
frameOffset = 0;
uint16_t tmp16;
/********************************************************************/
/* Fixed start to each frame (allowing heuristic dissector to work) */
/* Not NULL terminated */
memset(g_frameBuffer+g_frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
memset(frameBuffer+frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
memcpy(g_frameBuffer+g_frameOffset, MAC_LTE_START_STRING,
memcpy(frameBuffer+frameOffset, MAC_LTE_START_STRING,
strlen(MAC_LTE_START_STRING));
g_frameOffset += strlen(MAC_LTE_START_STRING);
frameOffset += strlen(MAC_LTE_START_STRING);
/******************************************************************************/
/* Now write out fixed fields (the mandatory elements of struct mac_lte_info) */
g_frameBuffer[g_frameOffset++] = radioType;
g_frameBuffer[g_frameOffset++] = direction;
g_frameBuffer[g_frameOffset++] = rntiType;
frameBuffer[frameOffset++] = radioType;
frameBuffer[frameOffset++] = direction;
frameBuffer[frameOffset++] = rntiType;
/*************************************/
/* Now optional fields */
/* RNTI */
g_frameBuffer[g_frameOffset++] = MAC_LTE_RNTI_TAG;
frameBuffer[frameOffset++] = MAC_LTE_RNTI_TAG;
tmp16 = htons(rnti);
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
/* UEId */
g_frameBuffer[g_frameOffset++] = MAC_LTE_UEID_TAG;
frameBuffer[frameOffset++] = MAC_LTE_UEID_TAG;
tmp16 = htons(ueid);
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
/* Subframe number */
g_frameBuffer[g_frameOffset++] = MAC_LTE_SUBFRAME_TAG;
frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG;
tmp16 = htons(subframeNumber); // frame counter : this will give an expert info as wireshark expects SF and not F
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
g_frameBuffer[g_frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
g_frameBuffer[g_frameOffset++] = crcStatus;
frameBuffer[frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
frameBuffer[frameOffset++] = crcStatus;
#ifdef WIRESHARK_DEV
g_frameOffset += 2;
frameOffset += 2;
tmp16 = htons(subframeNumber); // subframe
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
#endif
/***********************************************************/
/* For these optional fields, no need to encode if value is default */
if (!isPredefinedData) {
g_frameBuffer[g_frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
g_frameBuffer[g_frameOffset++] = isPredefinedData;
frameBuffer[frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
frameBuffer[frameOffset++] = isPredefinedData;
}
if (retx != 0) {
g_frameBuffer[g_frameOffset++] = MAC_LTE_RETX_TAG;
g_frameBuffer[g_frameOffset++] = retx;
frameBuffer[frameOffset++] = MAC_LTE_RETX_TAG;
frameBuffer[frameOffset++] = retx;
}
#ifdef WIRESHARK_DEV
......@@ -347,19 +342,19 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
switch (oob_event) {
case ltemac_send_preamble :
LOG_D(OPT,"oob event %d %d\n",ltemac_send_preamble );
//g_frameBuffer[g_frameOffset++]=0;
//g_frameBuffer[g_frameOffset++]=0;
//g_frameBuffer[g_frameOffset++]=0;
g_frameBuffer[g_frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
g_frameBuffer[g_frameOffset++]=ltemac_send_preamble;
g_frameBuffer[g_frameOffset++]=rnti; // is the preamble
g_frameBuffer[g_frameOffset++]=oob_event_value;
//frameBuffer[frameOffset++]=0;
//frameBuffer[frameOffset++]=0;
//frameBuffer[frameOffset++]=0;
frameBuffer[frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
frameBuffer[frameOffset++]=ltemac_send_preamble;
frameBuffer[frameOffset++]=rnti; // is the preamble
frameBuffer[frameOffset++]=oob_event_value;
break;
case ltemac_send_sr:
g_frameBuffer[g_frameOffset++]=ltemac_send_sr;
g_frameOffset+=2;
g_frameBuffer[g_frameOffset++]=oob_event_value;
frameBuffer[frameOffset++]=ltemac_send_sr;
frameOffset+=2;
frameBuffer[frameOffset++]=oob_event_value;
break;
case ltemac_sr_failure:
......@@ -372,23 +367,23 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
#endif
/***************************************/
/* Now write the MAC PDU */
g_frameBuffer[g_frameOffset++] = MAC_LTE_PAYLOAD_TAG;
frameBuffer[frameOffset++] = MAC_LTE_PAYLOAD_TAG;
/* Append actual PDU */
//memcpy(g_frameBuffer+g_frameOffset, g_PDUBuffer, g_PDUOffset);
//g_frameOffset += g_PDUOffset;
//memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
//frameOffset += g_PDUOffset;
if (pdu_buffer != NULL) {
memcpy(g_frameBuffer+g_frameOffset, (void*)pdu_buffer, pdu_buffer_size);
g_frameOffset += pdu_buffer_size;
memcpy(frameBuffer+frameOffset, (void*)pdu_buffer, pdu_buffer_size);
frameOffset += pdu_buffer_size;
}
/* Send out the data over the UDP socket */
bytesSent = sendto(g_socksd, g_frameBuffer, g_frameOffset, 0,
bytesSent = sendto(g_socksd, frameBuffer, frameOffset, 0,
(const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
if (bytesSent != g_frameOffset) {
if (bytesSent != frameOffset) {
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
g_frameOffset, bytesSent, errno);
frameOffset, bytesSent, errno);
//exit(1);
}
}
......@@ -509,6 +504,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
/*---------------------------------------------------*/
int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
{
uint16_t in_port;
subframesSinceCaptureStart = 0;
if (path != NULL) {
......@@ -612,37 +608,4 @@ void terminate_opt(void)
break;
}
}
/*
double *timing_analyzer(int index, int direction ){
//
int i;
if (direction==0)// in
{
timing_in[index]=clock();
//if(timing_out[index+100]>timing_in[index+100]);
//timing_perf[index+100] +=(double)((double)(timing_out[index+100]-timing_in[index+100])/(double)CLOCKS_PER_SEC);
}
else
{
timing_out[index]=clock();
if(index==5)timing_perf[index]=0;
timing_perf[index] +=(double)((double)(timing_out[index]-timing_in[index])/(((double)CLOCKS_PER_SEC)/1000000));
//LOG_I(OPT,"timing_analyser index %d =%f\n",index,timing_perf[index]);
init_value++;
if(init_value==500)
{
for(i=0;i<6;i++)
{
LOG_I(OPT,"timing_analyser index %d =%f\n",i,timing_perf[i]);
}
init_value=0;
}
return(&timing_perf[0]);
}
}
*/
......@@ -49,15 +49,16 @@ NUM_eNB=1
NUM_TRIALS=3
PRB=[25,50,100]
MCS=[0,4,9,10,13,16,17,22,27]
MCS=[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]
#MCS=[0,4,9,10,13,16,17,22,27]
#PRB=[100]
#MCS=[16]
ANT_TX=1 # 2
ANT_TX=2 # 2
ANT_RX=2 # 2
CHANNEL=["N"]
#CHANNEL=["C","E","F","G","H","I","L","M"] # A,B,C,D,E,F,
TX_MODE=2 # 2,
MIN_SNR=0
MIN_SNR=10
MAX_SNR=40
PERF=75
OPT="-L"
......@@ -69,9 +70,9 @@ FRAME=2000
def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
case = '10'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
oai.send('cd $OPENAIR_TARGETS;')
oai.send('cd bin;')
oai.send('cp ./ulsim.Rel10 ./ulsim.Rel10.'+host)
try:
log.start()
test = '300'
......@@ -80,13 +81,13 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + host + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + host + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Exiting', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + host + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'FATAL', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
......@@ -100,42 +101,47 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
diag = 'no diagnostic is available, check the log file'
for i in range(len(PRB)):
for o in range(len(CHANNEL)):
MIN_SNR=0
MIN_SNR=10
for j in range(len(MCS)):
for m in range (1,ANT_RX):
for p in range(1,TX_MODE):
for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] :
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace
if cpu > -1 :
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.rel8.'+ host + ' ' + conf + tee
else :
cmd = './ulsim.rel8.'+ host + ' ' + conf + tee
if debug :
print cmd
for r in range(5,PRB[i]):
for q in range(MIN_SNR,MAX_SNR):
if r ==7 or r ==11 or r ==14 or r == 17 or r==19 or r == 21 or r == 23 or r == 26 or r == 28 :
continue
# match = oai.send_expect_re(cmd, 'passed', 0, 1000)
match =1
if match :
log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q - 1 # just to speed up the test
test+=1
break # found the smallest snr
else :
if q == MAX_SNR -1 :
log.skip(case,str(test), name, conf,'','',logfile)
conf = '-B' + str(PRB[i]) + ' -r'+str(r) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+ '_rb'+str(r)+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace
if cpu > -1 :
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.Rel10.'+ host + ' ' + conf + tee
else :
cmd = './ulsim.Rel10.'+ host + ' ' + conf + tee
if debug :
print cmd
match = oai.send_expect_re(cmd, 'passed', 0, 1000)
#match =1
if match :
log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q - 1 # just to speed up the test
test+=1
break
try:
if os.path.isfile(trace) :
os.remove(trace)
except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror))
break # found the smallest snr
else :
if q == MAX_SNR -1 :
log.skip(case,str(test), name, conf,'','',logfile)
test+=1
break
try:
if os.path.isfile(trace) :
os.remove(trace)
except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror))
except log.err, e:
......
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