Commit e161c30c authored by Elena Lukashova's avatar Elena Lukashova
Browse files

Merge branch 'develop' into mmse_receiver

parents 240c4299 10944d4a
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/socket.h> #include <sys/socket.h>
#include "common/config/config_userapi.h"
#define QUIT(x) do { \ #define QUIT(x) do { \
printf("T tracer: QUIT: %s\n", x); \ printf("T tracer: QUIT: %s\n", x); \
exit(1); \ exit(1); \
...@@ -17,6 +19,7 @@ ...@@ -17,6 +19,7 @@
/* array used to activate/disactivate a log */ /* array used to activate/disactivate a log */
static int T_IDs[T_NUMBER_OF_IDS]; static int T_IDs[T_NUMBER_OF_IDS];
int *T_active = T_IDs; int *T_active = T_IDs;
int T_stdout;
static int T_socket; static int T_socket;
...@@ -157,3 +160,28 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork) ...@@ -157,3 +160,28 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
new_thread(T_receive_thread, NULL); new_thread(T_receive_thread, NULL);
} }
void T_Config_Init(void)
{
int T_port; /* by default we wait for the tracer */
int T_nowait; /* default port to listen to to wait for the tracer */
int T_dont_fork; /* default is to fork, see 'T_init' to understand */
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC ;
/* compatibility: look for TTracer parameters in root section */
config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),NULL);
/* but for a cleaner config file, TTracer params should be defined in a specific section... */
int ret = config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),TTRACER_CONFIG_PREFIX);
if (ret <0) {
printf( "TTracer configuration couldn't be performed via config module\n");
}
if (T_stdout == 0) {
T_init(T_port, 1-T_nowait, T_dont_fork);
} else {
for( int i=0 ; i<T_NUMBER_OF_IDS ; i++ ) {
T_active[i] = T_ACTIVE_STDOUT;
}
}
}
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
/* T message IDs */ /* T message IDs */
#include "T_IDs.h" #include "T_IDs.h"
#define T_ACTIVE_STDOUT 2
/* known type - this is where you add new types */ /* known type - this is where you add new types */
#define T_INT(x) int, (x) #define T_INT(x) int, (x)
...@@ -94,12 +95,12 @@ struct T_header; ...@@ -94,12 +95,12 @@ struct T_header;
#define T_ID(x) ((struct T_header *)(uintptr_t)(x)) #define T_ID(x) ((struct T_header *)(uintptr_t)(x))
/* T macro tricks */ /* T macro tricks */
extern int T_stdout;
#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\ #define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\
20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__) 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\ #define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
#define T(...) TN(__VA_ARGS__) #define T(...) if(T_stdout == 0) {TN(__VA_ARGS__);}
/* type used to send arbitrary buffer data */ /* type used to send arbitrary buffer data */
typedef struct { typedef struct {
...@@ -109,7 +110,7 @@ typedef struct { ...@@ -109,7 +110,7 @@ typedef struct {
extern volatile int *T_freelist_head; extern volatile int *T_freelist_head;
extern T_cache_t *T_cache; extern T_cache_t *T_cache;
extern int *T_active;
/* When running the basic simulator, we may fill the T cache too fast. /* When running the basic simulator, we may fill the T cache too fast.
* Let's not crash if it's full, just wait. * Let's not crash if it's full, just wait.
*/ */
...@@ -564,10 +565,30 @@ extern T_cache_t *T_cache; ...@@ -564,10 +565,30 @@ extern T_cache_t *T_cache;
} \ } \
} while (0) } while (0)
extern int *T_active;
void T_init(int remote_port, int wait_for_tracer, int dont_fork); #define CONFIG_HLP_TPORT "tracer port\n"
#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
#define CONFIG_HLP_STDOUT "print log messges on console\n"
#define TTRACER_CONFIG_PREFIX "TTracer"
/*------------------------------------------------------------------------------------------------------------------------------------------*/
/* configuration parameters for TTRACE utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_TTRACEPARAMS_DESC { \
{"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:2021, TYPE_INT, 0}, \
{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0}, \
{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0}, \
{"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0}, \
}
/* log on stdout */
void T_init(int remote_port, int wait_for_tracer, int dont_fork);
void T_Config_Init(void);
#else /* T_TRACER */ #else /* T_TRACER */
/* if T_TRACER is not defined or is 0, the T is deactivated */ /* if T_TRACER is not defined or is 0, the T is deactivated */
......
...@@ -330,14 +330,15 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me ...@@ -330,14 +330,15 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
if (destination_task_id != TASK_UNKNOWN) { if (destination_task_id != TASK_UNKNOWN) {
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) { if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED ||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), ended destination task!\n", itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) {
itti_desc.messages_info[message_id].name, ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), unconfigured or ended destination task!\n",
message_number, itti_desc.messages_info[message_id].name,
priority, message_number,
itti_get_task_name(origin_task_id), priority,
destination_task_id, itti_get_task_name(origin_task_id),
itti_get_task_name(destination_task_id)); destination_task_id,
itti_get_task_name(destination_task_id));
} else { } else {
if(!emulate_rf){ if(!emulate_rf){
/* We cannot send a message if the task is not running */ /* We cannot send a message if the task is not running */
...@@ -425,14 +426,15 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance ...@@ -425,14 +426,15 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance
if (destination_task_id != TASK_UNKNOWN) { if (destination_task_id != TASK_UNKNOWN) {
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) { if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED ||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), ended destination task!\n", itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) {
itti_desc.messages_info[message_id].name, ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), unconfigured or ended destination task!\n",
message_number, itti_desc.messages_info[message_id].name,
priority, message_number,
itti_get_task_name(origin_task_id), priority,
destination_task_id, itti_get_task_name(origin_task_id),
itti_get_task_name(destination_task_id)); destination_task_id,
itti_get_task_name(destination_task_id));
} else { } else {
/* We cannot send a message if the task is not running */ /* We cannot send a message if the task is not running */
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY, AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "UTIL/LOG/log.h" #include "UTIL/LOG/log.h"
#include "openair1/PHY/extern.h" #include "openair1/PHY/phy_extern.h"
#define TELNETVAR_PHYCC0 0 #define TELNETVAR_PHYCC0 0
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include "log.h" #include "log.h"
#include "log_extern.h" #include "log_extern.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#include "openair1/PHY/extern.h" #include "openair1/PHY/phy_extern.h"
#include "telnetsrv_proccmd.h" #include "telnetsrv_proccmd.h"
void decode_procstat(char *record, int debug, telnet_printfunc_t prnt) void decode_procstat(char *record, int debug, telnet_printfunc_t prnt)
...@@ -193,7 +193,6 @@ struct dirent *entry; ...@@ -193,7 +193,6 @@ struct dirent *entry;
int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt)
{ {
extern log_t *g_log;
if (debug > 0) if (debug > 0)
prnt(" proccmd_show received %s\n",buf); prnt(" proccmd_show received %s\n",buf);
...@@ -203,10 +202,12 @@ extern log_t *g_log; ...@@ -203,10 +202,12 @@ extern log_t *g_log;
if (strcasestr(buf,"loglvl") != NULL) { if (strcasestr(buf,"loglvl") != NULL) {
prnt("component verbosity level enabled\n"); prnt("component verbosity level enabled\n");
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
prnt("%02i %17.17s:%10.10s%10.10s %s\n",i ,g_log->log_component[i].name, if (g_log->log_component[i].name != NULL) {
map_int_to_str(log_verbosity_names,g_log->log_component[i].flag), prnt("%02i %17.17s:%10.10s%10.10s %s\n",i ,g_log->log_component[i].name,
map_int_to_str(log_level_names,g_log->log_component[i].level), map_int_to_str(log_verbosity_names,g_log->log_component[i].flag),
((g_log->log_component[i].interval>0)?"Y":"N") ); map_int_to_str(log_level_names,g_log->log_component[i].level),
((g_log->log_component[i].interval>0)?"Y":"N") );
}
} }
} }
if (strcasestr(buf,"config") != NULL) { if (strcasestr(buf,"config") != NULL) {
...@@ -368,6 +369,15 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); ...@@ -368,6 +369,15 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2);
if (logparam != NULL) free(logparam); if (logparam != NULL) free(logparam);
if (tmpstr != NULL) free(tmpstr); if (tmpstr != NULL) free(tmpstr);
for (int i=idx1; i<=idx2 ; i++) { for (int i=idx1; i<=idx2 ; i++) {
if (level < 0) {
level=g_log->log_component[i].level;
}
if (verbosity < 0) {
verbosity=g_log->log_component[i].flag;
}
if (interval < 0) {
interval=g_log->log_component[i].interval;
}
set_comp_log(i, level, verbosity, interval); set_comp_log(i, level, verbosity, interval);
prnt("log level/verbosity comp %i %s set to %s / %s (%s)\n", prnt("log level/verbosity comp %i %s set to %s / %s (%s)\n",
i,((g_log->log_component[i].name==NULL)?"":g_log->log_component[i].name), i,((g_log->log_component[i].name==NULL)?"":g_log->log_component[i].name),
......
...@@ -2924,7 +2924,7 @@ static uint8_t unpack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa ...@@ -2924,7 +2924,7 @@ static uint8_t unpack_dl_config_bch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa
nfapi_dl_config_bch_pdu_rel8_t* bch_pdu_rel8 = (nfapi_dl_config_bch_pdu_rel8_t*)tlv; nfapi_dl_config_bch_pdu_rel8_t* bch_pdu_rel8 = (nfapi_dl_config_bch_pdu_rel8_t*)tlv;
return ( pull16(ppReadPackedMsg, &bch_pdu_rel8->length, end) && return ( pull16(ppReadPackedMsg, &bch_pdu_rel8->length, end) &&
pull16(ppReadPackedMsg, &bch_pdu_rel8->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&bch_pdu_rel8->pdu_index, end) &&
pull16(ppReadPackedMsg, &bch_pdu_rel8->transmission_power, end)); pull16(ppReadPackedMsg, &bch_pdu_rel8->transmission_power, end));
} }
...@@ -2933,7 +2933,7 @@ static uint8_t unpack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa ...@@ -2933,7 +2933,7 @@ static uint8_t unpack_dl_config_mch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa
nfapi_dl_config_mch_pdu_rel8_t* mch_pdu_rel8 = (nfapi_dl_config_mch_pdu_rel8_t*)tlv; nfapi_dl_config_mch_pdu_rel8_t* mch_pdu_rel8 = (nfapi_dl_config_mch_pdu_rel8_t*)tlv;
return (pull16(ppReadPackedMsg, &mch_pdu_rel8->length, end) && return (pull16(ppReadPackedMsg, &mch_pdu_rel8->length, end) &&
pull16(ppReadPackedMsg, &mch_pdu_rel8->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&mch_pdu_rel8->pdu_index, end) &&
pull16(ppReadPackedMsg, &mch_pdu_rel8->rnti, end) && pull16(ppReadPackedMsg, &mch_pdu_rel8->rnti, end) &&
pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, end) && pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, end) &&
pull32(ppReadPackedMsg, &mch_pdu_rel8->resource_block_coding, end) && pull32(ppReadPackedMsg, &mch_pdu_rel8->resource_block_coding, end) &&
...@@ -2947,7 +2947,7 @@ static uint8_t unpack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppRead ...@@ -2947,7 +2947,7 @@ static uint8_t unpack_dl_config_dlsch_pdu_rel8_value(void *tlv, uint8_t **ppRead
nfapi_dl_config_dlsch_pdu_rel8_t* dlsch_pdu_rel8 = (nfapi_dl_config_dlsch_pdu_rel8_t*)tlv; nfapi_dl_config_dlsch_pdu_rel8_t* dlsch_pdu_rel8 = (nfapi_dl_config_dlsch_pdu_rel8_t*)tlv;
if (!(pull16(ppReadPackedMsg, &dlsch_pdu_rel8->length, end) && if (!(pull16(ppReadPackedMsg, &dlsch_pdu_rel8->length, end) &&
pull16(ppReadPackedMsg, &dlsch_pdu_rel8->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&dlsch_pdu_rel8->pdu_index, end) &&
pull16(ppReadPackedMsg, &dlsch_pdu_rel8->rnti, end) && pull16(ppReadPackedMsg, &dlsch_pdu_rel8->rnti, end) &&
pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, end) && pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, end) &&
pull8(ppReadPackedMsg, &dlsch_pdu_rel8->virtual_resource_block_assignment_flag, end) && pull8(ppReadPackedMsg, &dlsch_pdu_rel8->virtual_resource_block_assignment_flag, end) &&
...@@ -3033,7 +3033,7 @@ static uint8_t unpack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa ...@@ -3033,7 +3033,7 @@ static uint8_t unpack_dl_config_pch_pdu_rel8_value(void *tlv, uint8_t **ppReadPa
nfapi_dl_config_pch_pdu_rel8_t* pch_pdu_rel8 = (nfapi_dl_config_pch_pdu_rel8_t*)tlv; nfapi_dl_config_pch_pdu_rel8_t* pch_pdu_rel8 = (nfapi_dl_config_pch_pdu_rel8_t*)tlv;
return ( pull16(ppReadPackedMsg, &pch_pdu_rel8->length, end) && return ( pull16(ppReadPackedMsg, &pch_pdu_rel8->length, end) &&
pull16(ppReadPackedMsg, &pch_pdu_rel8->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&pch_pdu_rel8->pdu_index, end) &&
pull16(ppReadPackedMsg, &pch_pdu_rel8->p_rnti, end) && pull16(ppReadPackedMsg, &pch_pdu_rel8->p_rnti, end) &&
pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, end) && pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, end) &&
pull8(ppReadPackedMsg, &pch_pdu_rel8->virtual_resource_block_assignment_flag, end) && pull8(ppReadPackedMsg, &pch_pdu_rel8->virtual_resource_block_assignment_flag, end) &&
...@@ -3179,7 +3179,7 @@ static uint8_t unpack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppRead ...@@ -3179,7 +3179,7 @@ static uint8_t unpack_dl_config_nbch_pdu_rel13_value(void *tlv, uint8_t **ppRead
nfapi_dl_config_nbch_pdu_rel13_t* nbch_params_rel13 = (nfapi_dl_config_nbch_pdu_rel13_t*)tlv; nfapi_dl_config_nbch_pdu_rel13_t* nbch_params_rel13 = (nfapi_dl_config_nbch_pdu_rel13_t*)tlv;
return ( pull16(ppReadPackedMsg, &nbch_params_rel13->length, end) && return ( pull16(ppReadPackedMsg, &nbch_params_rel13->length, end) &&
pull16(ppReadPackedMsg, &nbch_params_rel13->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&nbch_params_rel13->pdu_index, end) &&
pull16(ppReadPackedMsg, &nbch_params_rel13->transmission_power, end) && pull16(ppReadPackedMsg, &nbch_params_rel13->transmission_power, end) &&
pull16(ppReadPackedMsg, &nbch_params_rel13->hyper_sfn_2_lsbs, end)); pull16(ppReadPackedMsg, &nbch_params_rel13->hyper_sfn_2_lsbs, end));
} }
...@@ -3189,7 +3189,7 @@ static uint8_t unpack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppRe ...@@ -3189,7 +3189,7 @@ static uint8_t unpack_dl_config_npdcch_pdu_rel13_value(void *tlv, uint8_t **ppRe
nfapi_dl_config_npdcch_pdu_rel13_t* npdcch_params_rel13 = (nfapi_dl_config_npdcch_pdu_rel13_t*)tlv; nfapi_dl_config_npdcch_pdu_rel13_t* npdcch_params_rel13 = (nfapi_dl_config_npdcch_pdu_rel13_t*)tlv;
return ( pull16(ppReadPackedMsg, &npdcch_params_rel13->length, end) && return ( pull16(ppReadPackedMsg, &npdcch_params_rel13->length, end) &&
pull16(ppReadPackedMsg, &npdcch_params_rel13->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&npdcch_params_rel13->pdu_index, end) &&
pull8(ppReadPackedMsg, &npdcch_params_rel13->ncce_index, end) && pull8(ppReadPackedMsg, &npdcch_params_rel13->ncce_index, end) &&
pull8(ppReadPackedMsg, &npdcch_params_rel13->aggregation_level, end) && pull8(ppReadPackedMsg, &npdcch_params_rel13->aggregation_level, end) &&
pull8(ppReadPackedMsg, &npdcch_params_rel13->start_symbol, end) && pull8(ppReadPackedMsg, &npdcch_params_rel13->start_symbol, end) &&
...@@ -3218,7 +3218,7 @@ static uint8_t unpack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppRe ...@@ -3218,7 +3218,7 @@ static uint8_t unpack_dl_config_ndlsch_pdu_rel13_value(void *tlv, uint8_t **ppRe
nfapi_dl_config_ndlsch_pdu_rel13_t* ndlsch_params_rel13 = (nfapi_dl_config_ndlsch_pdu_rel13_t*)tlv; nfapi_dl_config_ndlsch_pdu_rel13_t* ndlsch_params_rel13 = (nfapi_dl_config_ndlsch_pdu_rel13_t*)tlv;
return ( pull16(ppReadPackedMsg, &ndlsch_params_rel13->length, end) && return ( pull16(ppReadPackedMsg, &ndlsch_params_rel13->length, end) &&
pull16(ppReadPackedMsg, &ndlsch_params_rel13->pdu_index, end) && pull16(ppReadPackedMsg, (uint16_t *)&ndlsch_params_rel13->pdu_index, end) &&
pull8(ppReadPackedMsg, &ndlsch_params_rel13->start_symbol, end) && pull8(ppReadPackedMsg, &ndlsch_params_rel13->start_symbol, end) &&
pull8(ppReadPackedMsg, &ndlsch_params_rel13->rnti_type, end) && pull8(ppReadPackedMsg, &ndlsch_params_rel13->rnti_type, end) &&
pull16(ppReadPackedMsg, &ndlsch_params_rel13->rnti, end) && pull16(ppReadPackedMsg, &ndlsch_params_rel13->rnti, end) &&
...@@ -3602,7 +3602,7 @@ static uint8_t unpack_ul_config_ue_info_rel8_value(void *tlv, uint8_t **ppReadPa ...@@ -3602,7 +3602,7 @@ static uint8_t unpack_ul_config_ue_info_rel8_value(void *tlv, uint8_t **ppReadPa
nfapi_ul_config_ue_information_rel8_t* ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t*)tlv; nfapi_ul_config_ue_information_rel8_t* ue_info_rel8 = (nfapi_ul_config_ue_information_rel8_t*)tlv;
return (pull32(ppReadPackedMsg, &ue_info_rel8->handle, end) && return (pull32(ppReadPackedMsg, &ue_info_rel8->handle, end) &&
pull16(ppReadPackedMsg, &ue_info_rel8->rnti, end)); pull16(ppReadPackedMsg, (uint16_t *)&ue_info_rel8->rnti, end));
} }
static uint8_t unpack_ul_config_ue_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) static uint8_t unpack_ul_config_ue_info_rel11_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{ {
......
...@@ -1046,6 +1046,9 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ...@@ -1046,6 +1046,9 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
return(9); return(9);
else else
return((n+6)%10); return((n+6)%10);
LOG_E(PHY, "%s %s:%i pdcch allocation error\n",__FUNCTION__,__FILE__,__LINE__);
return 0;
} }
uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n) uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n)
...@@ -1056,6 +1059,9 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui ...@@ -1056,6 +1059,9 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
(frame_parms->tdd_config == 1)) { (frame_parms->tdd_config == 1)) {
if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5 if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5
ul_frame = (frame + (n < 5 ? 0 : 1)); ul_frame = (frame + (n < 5 ? 0 : 1));
} else {
LOG_E(PHY, "frame %d subframe %d: PUSCH frame = ?\n", frame, n);
ul_frame = 0;
} }
} else if ((frame_parms->frame_type == TDD) && } else if ((frame_parms->frame_type == TDD) &&
(frame_parms->tdd_config == 6) && (frame_parms->tdd_config == 6) &&
......
...@@ -2103,30 +2103,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2103,30 +2103,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8];//qpsk_table_a1[2],qpsk_table_b1[2] int16_t qam16_table_a1[4],qam64_table_a1[8],qam16_table_b1[4],qam64_table_b1[8];//qpsk_table_a1[2],qpsk_table_b1[2]
int16_t *qam_table_s0=NULL,*qam_table_s1=NULL; int16_t *qam_table_s0=NULL,*qam_table_s1=NULL;
#ifdef NEW_ALLOC_RE
/* TODO: variable to be removed? */
int (*allocate_REs)(PHY_VARS_eNB*,
int **,
uint32_t*,
uint32_t*,
uint16_t,
uint32_t,
LTE_DL_eNB_HARQ_t *,
LTE_DL_eNB_HARQ_t *,
uint8_t,
int16_t,
uint8_t,
int16_t *,
int16_t *,
uint32_t *,
uint8_t,
uint8_t,
uint8_t,
uint8_t,
uint8_t,
int *,
int *);
#endif
int P1_SHIFT[13],P2_SHIFT[13]; int P1_SHIFT[13],P2_SHIFT[13];
int offset,nushiftmod3; int offset,nushiftmod3;
...@@ -2373,52 +2349,23 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2373,52 +2349,23 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
re_offset = frame_parms->first_carrier_offset; re_offset = frame_parms->first_carrier_offset;
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe_offset*nsymb)); symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe_offset*nsymb));
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = allocate_REs_in_RB;
#endif
switch (mod_order0) { switch (mod_order0) {
case 2: case 2:
qam_table_s0 = NULL; qam_table_s0 = NULL;
/*if (pilots) { /*if (pilots) {
qam_table_s0 = qpsk_table_b0; qam_table_s0 = qpsk_table_b0;
#ifdef NEW_ALLOC_RE
// TODO: remove this code? //
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_QPSK_siso :
allocate_REs_in_RB;
#endif
} }
else { else {
qam_table_s0 = qpsk_table_a0; qam_table_s0 = qpsk_table_a0;
#ifdef NEW_ALLOC_RE
// TODO: remove this code? //
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_QPSK_siso :
allocate_REs_in_RB;
#endif
}*/ }*/
break; break;
case 4: case 4:
if (pilots) { if (pilots) {
qam_table_s0 = qam16_table_b0; qam_table_s0 = qam16_table_b0;
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_16QAM_siso :
allocate_REs_in_RB;
#endif
} }
else { else {
qam_table_s0 = qam16_table_a0; qam_table_s0 = qam16_table_a0;
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_16QAM_siso :
allocate_REs_in_RB;
#endif
} }
break; break;
...@@ -2426,21 +2373,9 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2426,21 +2373,9 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
case 6: case 6:
if (pilots) { if (pilots) {
qam_table_s0 = qam64_table_b0; qam_table_s0 = qam64_table_b0;
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_pilots_64QAM_siso :
allocate_REs_in_RB;
#endif
} }
else { else {
qam_table_s0 = qam64_table_a0; qam_table_s0 = qam64_table_a0;
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = (dlsch0->harq_processes[harq_pid]->mimo_mode == SISO) ?
allocate_REs_in_RB_no_pilots_64QAM_siso :
allocate_REs_in_RB;
#endif
} }
break; break;
...@@ -2449,10 +2384,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, ...@@ -2449,10 +2384,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
switch (mod_order1) { switch (mod_order1) {
case 2: case 2:
qam_table_s1 = NULL; qam_table_s1 = NULL;
#ifdef NEW_ALLOC_RE
/* TODO: remove this code? */
allocate_REs = allocate_REs_in_RB;
#endif
/*if (pilots) { /*if (pilots) {
qam_table_s1 = qpsk_table_b1; qam_table_s1 = qpsk_table_b1;
} }
......
...@@ -732,7 +732,6 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -732,7 +732,6 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
int i; int i;
LTE_eNB_UCI *uci; LTE_eNB_UCI *uci;
uint16_t tdd_multiplexing_mask=0; uint16_t tdd_multiplexing_mask=0;
int res;
for (i=0;i<NUMBER_OF_UE_MAX;i++) { for (i=0;i<NUMBER_OF_UE_MAX;i++) {
...@@ -1770,12 +1769,13 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq, ...@@ -1770,12 +1769,13 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
{ {
int subframe_tx = (subframe+6)%10; int subframe_tx = (subframe+6)%10;
int frame_tx = subframe_tx >= 6 ? (frame+1023)%1024 : frame; int frame_tx = subframe_tx >= 6 ? (frame+1023)%1024 : frame;
if (ulsch_harq->o_ACK[i] != 1) if (ulsch_harq->o_ACK[i] != 1) {
T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe),
T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx])); T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx]));
else } else {
T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(0), T_INT