diff --git a/common/utils/T/T.c b/common/utils/T/T.c index 92e70c221b6fd052e5f5c4804de8bc3f2edc4fff..acc44b0ff07308bf56dc4c083bf460978f99627a 100644 --- a/common/utils/T/T.c +++ b/common/utils/T/T.c @@ -9,6 +9,8 @@ #include <fcntl.h> #include <sys/socket.h> +#include "common/config/config_userapi.h" + #define QUIT(x) do { \ printf("T tracer: QUIT: %s\n", x); \ exit(1); \ @@ -17,6 +19,7 @@ /* array used to activate/disactivate a log */ static int T_IDs[T_NUMBER_OF_IDS]; int *T_active = T_IDs; +int T_stdout; static int T_socket; @@ -157,3 +160,28 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork) 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; + } + } +} diff --git a/common/utils/T/T.h b/common/utils/T/T.h index c44b9013cd4561741c2f5ed220902ef419eb3cc9..533e6c8ed7d8b8f3fbf4851e60b3150abee48133 100644 --- a/common/utils/T/T.h +++ b/common/utils/T/T.h @@ -14,6 +14,7 @@ /* T message IDs */ #include "T_IDs.h" +#define T_ACTIVE_STDOUT 2 /* known type - this is where you add new types */ #define T_INT(x) int, (x) @@ -94,12 +95,12 @@ struct T_header; #define T_ID(x) ((struct T_header *)(uintptr_t)(x)) /* 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,\ 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,\ 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 */ typedef struct { @@ -109,7 +110,7 @@ typedef struct { extern volatile int *T_freelist_head; extern T_cache_t *T_cache; - +extern int *T_active; /* When running the basic simulator, we may fill the T cache too fast. * Let's not crash if it's full, just wait. */ @@ -564,10 +565,30 @@ extern T_cache_t *T_cache; } \ } 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 */ /* if T_TRACER is not defined or is 0, the T is deactivated */ diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c index 9dc7876d9f6bd9721587cfba9582b46636d44869..486a53427032733bfccd7bc6c6a9c821e7127cca 100644 --- a/common/utils/itti/intertask_interface.c +++ b/common/utils/itti/intertask_interface.c @@ -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 (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.messages_info[message_id].name, - message_number, - priority, - itti_get_task_name(origin_task_id), - destination_task_id, - itti_get_task_name(destination_task_id)); + if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED || + itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) { + 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", + itti_desc.messages_info[message_id].name, + message_number, + priority, + itti_get_task_name(origin_task_id), + destination_task_id, + itti_get_task_name(destination_task_id)); } else { if(!emulate_rf){ /* 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 if (destination_task_id != TASK_UNKNOWN) { - 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.messages_info[message_id].name, - message_number, - priority, - itti_get_task_name(origin_task_id), - destination_task_id, - itti_get_task_name(destination_task_id)); + if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED || + itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) { + 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", + itti_desc.messages_info[message_id].name, + message_number, + priority, + itti_get_task_name(origin_task_id), + destination_task_id, + itti_get_task_name(destination_task_id)); } else { /* We cannot send a message if the task is not running */ AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY, diff --git a/common/utils/telnetsrv/telnetsrv_phycmd.h b/common/utils/telnetsrv/telnetsrv_phycmd.h index 6e2b0ecacff74813b6635436dfea3fc6078995e9..3eaa9e168406d5a85167e62f5ea22000e4999503 100644 --- a/common/utils/telnetsrv/telnetsrv_phycmd.h +++ b/common/utils/telnetsrv/telnetsrv_phycmd.h @@ -35,7 +35,7 @@ #include "UTIL/LOG/log.h" -#include "openair1/PHY/extern.h" +#include "openair1/PHY/phy_extern.h" #define TELNETVAR_PHYCC0 0 diff --git a/common/utils/telnetsrv/telnetsrv_proccmd.c b/common/utils/telnetsrv/telnetsrv_proccmd.c index 91f0e9c93a591f04bb85ddd991c8cf9d2e1142cd..ac48dc527d7471ade3ce9ebe8173e1549ccbd0f9 100644 --- a/common/utils/telnetsrv/telnetsrv_proccmd.c +++ b/common/utils/telnetsrv/telnetsrv_proccmd.c @@ -55,7 +55,7 @@ #include "log.h" #include "log_extern.h" #include "common/config/config_userapi.h" -#include "openair1/PHY/extern.h" +#include "openair1/PHY/phy_extern.h" #include "telnetsrv_proccmd.h" void decode_procstat(char *record, int debug, telnet_printfunc_t prnt) @@ -193,7 +193,6 @@ struct dirent *entry; int proccmd_show(char *buf, int debug, telnet_printfunc_t prnt) { -extern log_t *g_log; if (debug > 0) prnt(" proccmd_show received %s\n",buf); @@ -203,10 +202,12 @@ extern log_t *g_log; if (strcasestr(buf,"loglvl") != NULL) { prnt("component verbosity level enabled\n"); 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, - map_int_to_str(log_verbosity_names,g_log->log_component[i].flag), - map_int_to_str(log_level_names,g_log->log_component[i].level), - ((g_log->log_component[i].interval>0)?"Y":"N") ); + if (g_log->log_component[i].name != NULL) { + prnt("%02i %17.17s:%10.10s%10.10s %s\n",i ,g_log->log_component[i].name, + map_int_to_str(log_verbosity_names,g_log->log_component[i].flag), + 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) { @@ -368,6 +369,15 @@ int s = sscanf(buf,"%ms %i-%i\n",&logsubcmd, &idx1,&idx2); if (logparam != NULL) free(logparam); if (tmpstr != NULL) free(tmpstr); 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); 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), diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 3754fe379fef576b75d2ea026f1a4c35007bd807..c180b5b0f9cfa24ae620950e19548d2b99387f3b 100644 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -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; 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)); } @@ -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; 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) && pull8(ppReadPackedMsg, &mch_pdu_rel8->resource_allocation_type, 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 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) && - 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) && pull8(ppReadPackedMsg, &dlsch_pdu_rel8->resource_allocation_type, 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 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) && - 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) && pull8(ppReadPackedMsg, &pch_pdu_rel8->resource_allocation_type, 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 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) && - 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->hyper_sfn_2_lsbs, end)); } @@ -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; 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->aggregation_level, 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 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) && - 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->rnti_type, 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 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) && - 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) { diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c index 0c09205b12d425e4a74776e6b63f061450b7a89e..6cb2ae47386c88e4234e6d157c5cc805223ad8f9 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c @@ -1046,6 +1046,9 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t return(9); else 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) @@ -1056,6 +1059,9 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui (frame_parms->tdd_config == 1)) { if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5 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) && (frame_parms->tdd_config == 6) && diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c index e39ab9a8eb9aa80804fb3be36faf143de9f8b32d..5bf6f073d86180cc41a5acdf6d025aa194c16c79 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c @@ -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 *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 offset,nushiftmod3; @@ -2373,52 +2349,23 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, re_offset = frame_parms->first_carrier_offset; 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) { case 2: qam_table_s0 = NULL; /*if (pilots) { 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 { 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; case 4: if (pilots) { 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 { 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; @@ -2426,21 +2373,9 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, case 6: if (pilots) { 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 { 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; @@ -2449,10 +2384,6 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB, switch (mod_order1) { case 2: qam_table_s1 = NULL; -#ifdef NEW_ALLOC_RE - /* TODO: remove this code? */ - allocate_REs = allocate_REs_in_RB; -#endif /*if (pilots) { qam_table_s1 = qpsk_table_b1; } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 69cd78c0adaf2550ce8230e71bbfe28fee4afb46..635d8c6b619855ef4755ec914a5aea8064b057b9 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -732,7 +732,6 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) int i; LTE_eNB_UCI *uci; uint16_t tdd_multiplexing_mask=0; - int res; 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, { int subframe_tx = (subframe+6)%10; 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_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(frame), T_INT(subframe), T_INT(rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx])); + } } #endif } @@ -1872,12 +1872,13 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB, { int subframe_tx = (subframe+6)%10; int frame_tx = subframe_tx >= 6 ? (frame+1023)%1024 : frame; - if (harq_ack[0] != 1) + if (harq_ack[0] != 1) { T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(0), T_INT(frame), T_INT(subframe), T_INT(uci->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(frame), T_INT(subframe), T_INT(uci->rnti), T_INT(eNB->dlsch[UE_id][0]->harq_ids[frame_tx%2][subframe_tx])); + } } #endif } diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c index 073610ffd2a9e83ac4b89c81e23872c480c038fe..17b12e762227fa470b061dfdec998e9700e901fe 100644 --- a/openair1/SCHED/ru_procedures.c +++ b/openair1/SCHED/ru_procedures.c @@ -64,7 +64,6 @@ void feptx0(RU_t *ru,int slot) { //int dummy_tx_b[7680*2] __attribute__((aligned(32))); unsigned int aa,slot_offset; - int i, tx_offset; int slot_sizeF = (fp->ofdm_symbol_size)* ((fp->Ncp==1) ? 6 : 7); int subframe = ru->proc.subframe_tx; diff --git a/openair1/SCHED/sched_common.h b/openair1/SCHED/sched_common.h index fdf365af1c72587f4506fa906ab860e56bd7c8ba..e579110a78849e21cf37c361ba689753cb3ae633 100644 --- a/openair1/SCHED/sched_common.h +++ b/openair1/SCHED/sched_common.h @@ -30,7 +30,7 @@ #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" - +#include "TDD-Config.h" /*! \brief Function to compute subframe Number(DL and S) as a function of Frame type and TDD Configuration @param frame_parms Pointer to DL frame parameter descriptor @returns Subframe Number (DL,S) @@ -341,6 +341,12 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset); + +/* from here: prototype added to remove compilation warnings, doc to be written by the author of the function */ + +int ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigned char subframe,unsigned char subframe_tx); + +void get_retransmission_timing(TDD_Config_t *tdd_Config, frame_t *frameP, sub_frame_t *subframeP); /*@}*/ diff --git a/openair1/SCHED_UE/phy_procedures_lte_ue.c b/openair1/SCHED_UE/phy_procedures_lte_ue.c index b73379a2b98286af690b1d1455accf625e1ad7e1..08e06294b1313bb30161101554725484c3c5b8b9 100644 --- a/openair1/SCHED_UE/phy_procedures_lte_ue.c +++ b/openair1/SCHED_UE/phy_procedures_lte_ue.c @@ -3600,7 +3600,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, LOG_D(PHY," ------ start turbo decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, subframe_rx, harq_pid); LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->nb_rb); - LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->rb_alloc_even); + LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, (unsigned int)((intptr_t)dlsch0->harq_processes[harq_pid]->rb_alloc_even)); LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Qm); LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->Nl); LOG_D(PHY,"start turbo decode for CW 0 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch0->harq_processes[harq_pid]->G); @@ -3663,7 +3663,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, #endif LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->nb_rb); - LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->rb_alloc_even); + LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> rb_alloc_even %x \n", frame_rx, subframe_rx, harq_pid, (uint16_t)((intptr_t)dlsch1->harq_processes[harq_pid]->rb_alloc_even)); LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Qm %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Qm); LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> Nl %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->Nl); LOG_D(PHY,"start turbo decode for CW 1 for AbsSubframe %d.%d / %d --> G %d \n", frame_rx, subframe_rx, harq_pid, dlsch1->harq_processes[harq_pid]->G); diff --git a/openair2/ENB_APP/NB_IoT_config.c b/openair2/ENB_APP/NB_IoT_config.c index 09e22ef8457b17578be6f03b9a17e4d3b8988607..08c3d30fa366cc0012c9550ea202d9b396567112 100644 --- a/openair2/ENB_APP/NB_IoT_config.c +++ b/openair2/ENB_APP/NB_IoT_config.c @@ -42,7 +42,7 @@ #endif #include "SystemInformationBlockType2.h" -#include "PHY/extern.h" +#include "PHY/phy_extern.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "common/config/config_userapi.h" #include "RRC_config_tools.h" diff --git a/openair2/LAYER2/MAC/config_NB_IoT.h b/openair2/LAYER2/MAC/config_NB_IoT.h index 0e497e3b0f407b9c3da8fd7d357375a5596f8422..fb8c85ebed22570bd49907f3d3b4021f496ceb65 100644 --- a/openair2/LAYER2/MAC/config_NB_IoT.h +++ b/openair2/LAYER2/MAC/config_NB_IoT.h @@ -21,7 +21,7 @@ typedef enum operationModeInf{ iNB_IoTand_DifferentPCI_r13 = 2, guardband_r13 = 3, standalone_r13 = 4 -}operationModeInf_t; +} operationModeInf_t; ///SIB1_SchedulingInfo_NB_IoT_r13 typedef enum si_Periodicity{ @@ -32,14 +32,14 @@ typedef enum si_Periodicity{ si_Periodicity_rf1024=10240, si_Periodicity_rf2048=20480, si_Periodicity_rf4096=40960 -}si_Periodicity_NB_IoT; +} si_Periodicity_NB_IoT; typedef enum si_RepetitionPattern{ si_RepetitionPattern_every2ndRF=0, si_RepetitionPattern_every4thRF, si_RepetitionPattern_every8thRF, si_RepetitionPattern_every16thRF -}si_RepetitionPattern_NB_IoT; +} si_RepetitionPattern_NB_IoT; typedef enum sib_MappingInfo{ sib2_v=0x1, @@ -48,7 +48,7 @@ typedef enum sib_MappingInfo{ sib5_v=0x8, sib14_v=0x10, sib16_v=0x20 -}sib_MappingInfo_NB_IoT; +} sib_MappingInfo_NB_IoT; typedef enum si_TB{ si_TB_56=2, @@ -59,7 +59,7 @@ typedef enum si_TB{ si_TB_440=8, si_TB_552=8, si_TB_680=8 -}si_TB_NB_IoT; +} si_TB_NB_IoT; ///RACH_ConfigCommon configuration @@ -72,7 +72,7 @@ typedef enum ra_ResponseWindowSize{ ra_ResponseWindowSize_pp7=7, ra_ResponseWindowSize_pp8=8, ra_ResponseWindowSize_pp10=10 -}ra_ResponseWindowSize_NB_IoT; +} ra_ResponseWindowSize_NB_IoT; typedef enum mac_ContentionResolutionTimer{ mac_ContentionResolutionTimer_pp1=1, @@ -83,7 +83,7 @@ typedef enum mac_ContentionResolutionTimer{ mac_ContentionResolutionTimer_pp16=16, mac_ContentionResolutionTimer_pp32=32, mac_ContentionResolutionTimer_pp64=64 -}mac_ContentionResolutionTimer_NB_IoT; +} mac_ContentionResolutionTimer_NB_IoT; ///NPRACH_ConfigSIB configuration @@ -96,7 +96,7 @@ typedef enum nprach_Periodicity{ nprach_Periodicity_ms640=640, nprach_Periodicity_ms1280=1280, nprach_Periodicity_ms2560=2560 -}nprach_Periodicity_NB_IoT; +} nprach_Periodicity_NB_IoT; typedef enum nprach_StartTime{ nprach_StartTime_ms8=8, @@ -107,7 +107,7 @@ typedef enum nprach_StartTime{ nprach_StartTime_ms256=256, nprach_StartTime_ms512=512, nprach_StartTime_ms1024=1024 -}nprach_StartTime_NB_IoT; +} nprach_StartTime_NB_IoT; typedef enum nprach_SubcarrierOffset{ nprach_SubcarrierOffset_n0=0, @@ -117,21 +117,21 @@ typedef enum nprach_SubcarrierOffset{ nprach_SubcarrierOffset_n2=2, nprach_SubcarrierOffset_n18=18, nprach_SubcarrierOffset_n34=34 -}nprach_SubcarrierOffset_NB_IoT; +} nprach_SubcarrierOffset_NB_IoT; typedef enum nprach_NumSubcarriers{ nprach_NumSubcarriers_n12=12, nprach_NumSubcarriers_n24=24, nprach_NumSubcarriers_n36=36, nprach_NumSubcarriers_n48=48 -}nprach_NumSubcarriers_NB_IoT; +} nprach_NumSubcarriers_NB_IoT; typedef enum nprach_SubcarrierMSG3_RangeStart{ nprach_SubcarrierMSG3_RangeStart_zero=0, nprach_SubcarrierMSG3_RangeStart_oneThird=1/3, nprach_SubcarrierMSG3_RangeStart_twoThird=2/3, nprach_SubcarrierMSG3_RangeStart_one=1 -}nprach_SubcarrierMSG3_RangeStart_NB_IoT; +} nprach_SubcarrierMSG3_RangeStart_NB_IoT; typedef enum maxNumPreambleAttemptCE{ maxNumPreambleAttemptCE_n3=3, @@ -141,7 +141,7 @@ typedef enum maxNumPreambleAttemptCE{ maxNumPreambleAttemptCE_n7=7, maxNumPreambleAttemptCE_n8=8, maxNumPreambleAttemptCE_n10=10 -}maxNumPreambleAttemptCE_NB_IoT; +} maxNumPreambleAttemptCE_NB_IoT; typedef enum numRepetitionsPerPreambleAttempt{ numRepetitionsPerPreambleAttempt_n1=1, @@ -152,7 +152,7 @@ typedef enum numRepetitionsPerPreambleAttempt{ numRepetitionsPerPreambleAttempt_n32=32, numRepetitionsPerPreambleAttempt_n64=64, numRepetitionsPerPreambleAttempt_n128=128 -}numRepetitionsPerPreambleAttempt_NB_IoT; +} numRepetitionsPerPreambleAttempt_NB_IoT; typedef enum npdcch_NumRepetitions_RA{ npdcch_NumRepetitions_RA_r1=1, @@ -167,7 +167,7 @@ typedef enum npdcch_NumRepetitions_RA{ npdcch_NumRepetitions_RA_r512=512, npdcch_NumRepetitions_RA_r1024=1024, npdcch_NumRepetitions_RA_r2048=2048 -}npdcch_NumRepetitions_RA_NB_IoT; +} npdcch_NumRepetitions_RA_NB_IoT; typedef enum npdcch_StartSF_CSS_RA{ npdcch_StartSF_CSS_RA_v1dot5=3/2, @@ -178,14 +178,14 @@ typedef enum npdcch_StartSF_CSS_RA{ npdcch_StartSF_CSS_RA_v32=32, npdcch_StartSF_CSS_RA_v48=48, npdcch_StartSF_CSS_RA_v64=64 -}npdcch_StartSF_CSS_RA_NB_IoT; +} npdcch_StartSF_CSS_RA_NB_IoT; typedef enum npdcch_Offset_RA{ zero=0, oneEighth=1/8, oneFourth=1/4, threeEighth=3/8 -}npdcch_Offset_RA_NB_IoT; +} npdcch_Offset_RA_NB_IoT; typedef enum si_window_length_e{ ms160=160, @@ -195,7 +195,7 @@ typedef enum si_window_length_e{ ms960=960, ms1280=1280, ms1600=1600 -}si_window_length_t; +} si_window_length_t; typedef enum si_periodicity_e{ rf64=640, @@ -205,14 +205,14 @@ typedef enum si_periodicity_e{ rf1024=10240, rf2048=20480, rf4096=40960 -}si_periodicity_t; +} si_periodicity_t; typedef enum si_repetition_pattern_e{ every2ndRF=20, every4thRF=40, every8thRF=80, every16thRF=160 -}si_repetition_pattern_t; +} si_repetition_pattern_t; typedef enum si_tb_e{ b56=2, @@ -223,7 +223,7 @@ typedef enum si_tb_e{ b440=8, b552=8, b680=8 -}si_tb_t; +} si_tb_t; typedef struct sibs_NB_IoT_sched_s{ @@ -232,21 +232,21 @@ typedef struct sibs_NB_IoT_sched_s{ sib_MappingInfo_NB_IoT sib_mapping_info; //bit vector si_tb_t si_tb; -}sibs_NB_IoT_sched_t; +} sibs_NB_IoT_sched_t; ///-------------------------------------------------------MAC--------------------------------------------------------------------/// typedef struct sib1_NB_IoT_sched_s{ int repetitions; // 4, 8, 16 int starting_rf; -}sib1_NB_IoT_sched_t; +} sib1_NB_IoT_sched_t; typedef struct { uint32_t mac_ra_ResponseWindowSize_NB_IoT; uint32_t mac_ContentionResolutionTimer_NB_IoT; -}mac_RACH_ConfigCommon_NB_IoT; +} mac_RACH_ConfigCommon_NB_IoT; typedef struct { @@ -262,7 +262,7 @@ typedef struct { uint32_t mac_npdcch_StartSF_CSS_RA_NB_IoT; // G uint32_t mac_npdcch_Offset_RA_NB_IoT; // alpha offset -}mac_NPRACH_ConfigSIB_NB_IoT; +} mac_NPRACH_ConfigSIB_NB_IoT; typedef struct{ //npdcch-NumRepetitions-r13 @@ -271,7 +271,7 @@ typedef struct{ double G; //npdcch-Offset-USS-r13 double a_offset; -}npdcch_ConfigDedicated_NB_IoT; +} npdcch_ConfigDedicated_NB_IoT; typedef struct rrc_config_NB_IoT_s{ @@ -296,6 +296,6 @@ typedef struct rrc_config_NB_IoT_s{ ///NPDCCH Dedicated config npdcch_ConfigDedicated_NB_IoT npdcch_ConfigDedicated[3]; -}rrc_config_NB_IoT_t; +} rrc_config_NB_IoT_t; #endif diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 9867f530cf1807237fddd7f99c14ecd25c923039..c108a141d8e544a0194c16caf5c4efff9c50e3b9 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -641,8 +641,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, #endif static int debug_flag=0; - void (*schedule_ulsch_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe); - void (*schedule_ue_spec_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, int *mbsfn_flag); + void (*schedule_ulsch_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe)=NULL; + void (*schedule_ue_spec_p)(module_id_t module_idP, frame_t frameP, sub_frame_t subframe, int *mbsfn_flag)=NULL; if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_DEFAULT){ schedule_ulsch_p = schedule_ulsch; schedule_ue_spec_p = schedule_dlsch; @@ -672,13 +672,22 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP, // This schedules SRS in subframeP schedule_SRS(module_idP, frameP, subframeP); // This schedules ULSCH in subframeP (dci0) - schedule_ulsch_p(module_idP, frameP, subframeP); + if (schedule_ulsch_p != NULL) { + schedule_ulsch_p(module_idP, frameP, subframeP); + } else { + LOG_E(MAC," %s %d: schedule_ulsch_p is NULL, function not called\n",__FILE__,__LINE__); + } // This schedules UCI_SR in subframeP schedule_SR(module_idP, frameP, subframeP); // This schedules UCI_CSI in subframeP schedule_CSI(module_idP, frameP, subframeP); // This schedules DLSCH in subframeP - schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status); + if (schedule_ue_spec_p != NULL) { + schedule_ue_spec_p(module_idP, frameP, subframeP, mbsfn_status); + } else { + LOG_E(MAC," %s %d: schedule_ue_spec_p is NULL, function not called\n",__FILE__,__LINE__); + } + } else{ schedule_ulsch_phy_test(module_idP,frameP,subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index b72a51cc36c847e6f5e6f64c380c6722c4f4d66a..a04ad64a1ff639921b194656d9d19348947d131d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -50,6 +50,7 @@ #include "RRC/LTE/rrc_extern.h" #include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h" +#include "SCHED/sched_common.h" //#include "LAYER2/MAC/pre_processor.c" #include "pdcp.h" @@ -62,6 +63,7 @@ #include "T.h" #include "common/ran_context.h" +#include "LAYER2/MAC/eNB_scheduler_fairRR.h" extern RAN_CONTEXT_t RC; diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index e9c54c7c7bc00c1572138a379df147873aca1d92..08b7eb18a0bddf49bc6ad2cdc42b79c5a28a0526 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -58,6 +58,7 @@ extern uint16_t frame_cnt; #include "common/ran_context.h" +#include "SCHED/sched_common.h" extern RAN_CONTEXT_t RC; @@ -1973,7 +1974,6 @@ int rrc_mac_remove_ue(module_id_t mod_idP, rnti_t rntiP) //------------------------------------------------------------------------------ { - int i; int j; UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list; int UE_id = find_UE_id(mod_idP,rntiP); @@ -3321,7 +3321,7 @@ void get_retransmission_timing(TDD_Config_t *tdd_Config, frame_t *frameP, else { AssertFatal(2 == 1, - "Illegal dl subframe %d for tdd config %d\n", *subframeP, + "Illegal dl subframe %d for tdd config %ld\n", *subframeP, tdd_Config->subframeAssignment); } break; @@ -3350,7 +3350,7 @@ uint8_t frame_subframe2_dl_harq_pid(TDD_Config_t *tdd_Config, int abs_frameP, su harq_pid = (((frame_cnt*1024 + abs_frameP) * 4) - 1 + get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP))%7;//4 dl subframe in a frame if(harq_pid < 0) harq_pid += 7; - LOG_D(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d)%7 = %d \n", + LOG_D(MAC,"[frame_subframe2_dl_harq_pid] (%d,%d) calculate harq_pid ((( %d * 1024 + %d) *4) - 1 + %d) = %d \n", (abs_frameP+1024)%1024,subframeP,frame_cnt,abs_frameP, get_dl_subframe_count(tdd_Config->subframeAssignment,subframeP),harq_pid); return harq_pid; diff --git a/openair2/LAYER2/MAC/mac_proto.h b/openair2/LAYER2/MAC/mac_proto.h index a20df2909d639bed2318ceb2e5126de863c226cb..20887a418026c1e150e9f01f231b6963ab0e7131 100644 --- a/openair2/LAYER2/MAC/mac_proto.h +++ b/openair2/LAYER2/MAC/mac_proto.h @@ -1242,5 +1242,7 @@ uint16_t flexran_nb_rbs_allowed_slice(float rb_percentage, int total_rbs); int ue_slice_membership(int UE_id, int slice_id); +/* from here: prototypes to get rid of compilation warnings: doc to be written by function author */ +uint8_t ul_subframe2_k_phich(COMMON_channels_t * cc, sub_frame_t ul_subframe); #endif /** @}*/ diff --git a/openair2/LAYER2/MAC/proto_NB_IoT.h b/openair2/LAYER2/MAC/proto_NB_IoT.h index 6e6d98eba1628abc8e20a6c46dae81de5722e4c7..913e3ebcce3106b55bd8bc30c188b471da6dd1e0 100644 --- a/openair2/LAYER2/MAC/proto_NB_IoT.h +++ b/openair2/LAYER2/MAC/proto_NB_IoT.h @@ -33,7 +33,7 @@ #include "openair1/PHY/LTE_TRANSPORT/defs_NB_IoT.h" #include "LAYER2/MAC/defs_NB_IoT.h" #include "COMMON/platform_types.h" -#include "openair2/RRC/LITE/defs_NB_IoT.h" +#include "openair2/RRC/LTE/defs_NB_IoT.h" /** \addtogroup _mac * @{ */ diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index cf99af604e6ff63359b24001f5646d910e39c9a2..6e06dd951832b93fa68366975a4eb073e78664b1 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -34,34 +34,6 @@ #ifndef __PDCP_H__ # define __PDCP_H__ //----------------------------------------------------------------------------- -# ifdef PDCP_C -# define private_pdcp(x) x -# define protected_pdcp(x) x -# define public_pdcp(x) x -# else -# define private_pdcp(x) -# define public_pdcp(x) extern x -# ifdef PDCP_FIFO_C -# define protected_pdcp(x) extern x -# else -# define protected_pdcp(x) -# endif -# endif - -# ifdef PDCP_FIFO_C -# define private_pdcp_fifo(x) x -# define protected_pdcp_fifo(x) x -# define public_pdcp_fifo(x) x -# else -# define private_pdcp_fifo(x) -# define public_pdcp_fifo(x) extern x -# ifdef PDCP_C -# define protected_pdcp_fifo(x) extern x -# else -# define protected_pdcp_fifo(x) -# endif -# endif -//----------------------------------------------------------------------------- #ifndef NON_ACCESS_STRATUM #include "UTIL/MEM/mem_block.h" #include "UTIL/LISTS/list.h" @@ -94,41 +66,41 @@ extern int pdcp_instance_cnt; int init_pdcp_thread(void); void cleanup_pdcp_thread(void); -public_pdcp(uint32_t Pdcp_stats_tx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]); -public_pdcp(uint32_t Pdcp_stats_tx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_throughput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_tx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); - -public_pdcp(uint32_t Pdcp_stats_rx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]); -public_pdcp(uint32_t Pdcp_stats_rx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_goodput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); -public_pdcp(uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]); - -public_pdcp(void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctxt_pP)); +uint32_t Pdcp_stats_tx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; +uint32_t Pdcp_stats_tx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_throughput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_tx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; + +uint32_t Pdcp_stats_rx_window_ms[MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; +uint32_t Pdcp_stats_rx[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_bytes[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_bytes_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_bytes_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_sn[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_goodput_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_aiat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_aiat_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_aiat_tmp_w[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_iat[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; +uint32_t Pdcp_stats_rx_outoforder[MAX_NUM_CCs][MAX_MOBILES_PER_ENB][NB_RB_MAX]; + +void pdcp_update_perioidical_stats(const protocol_ctxt_t* const ctxt_pP); /*Packet Probing for agent PDCP*/ -//public_pdcp(uint64_t *pdcp_packet_counter); -//public_pdcp(uint64_t *pdcp_size_packet); +//uint64_t *pdcp_packet_counter; +//uint64_t *pdcp_size_packet; typedef struct pdcp_enb_s { // used for eNB stats generation uint16_t uid[MAX_MOBILES_PER_ENB]; @@ -141,7 +113,7 @@ typedef struct pdcp_enb_s { } pdcp_enb_t; -public_pdcp(pdcp_enb_t pdcp_enb[MAX_NUM_CCs]); +pdcp_enb_t pdcp_enb[MAX_NUM_CCs]; typedef struct pdcp_stats_s { time_stats_t pdcp_run; @@ -251,7 +223,7 @@ typedef struct pdcp_mbms_s { * \note None * @ingroup _pdcp */ -public_pdcp(boolean_t pdcp_data_req( +boolean_t pdcp_data_req( protocol_ctxt_t* ctxt_pP, const srb_flag_t srb_flagP, const rb_id_t rb_id, @@ -264,7 +236,7 @@ public_pdcp(boolean_t pdcp_data_req( ,const uint32_t * const sourceL2Id ,const uint32_t * const destinationL2Id #endif - )); + ); /*! \fn boolean_t pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, mem_block_t*, boolean_t) * \brief This functions handles data transfer indications coming from RLC @@ -279,13 +251,13 @@ public_pdcp(boolean_t pdcp_data_req( * \note None * @ingroup _pdcp */ -public_pdcp(boolean_t pdcp_data_ind( +boolean_t pdcp_data_ind( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_id, const sdu_size_t sdu_buffer_size, - mem_block_t* const sdu_buffer)); + mem_block_t* const sdu_buffer); /*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t) * \brief This functions initializes relevant PDCP entity @@ -297,12 +269,12 @@ public_pdcp(boolean_t pdcp_data_ind( * \note None * @ingroup _pdcp */ -public_pdcp(void rrc_pdcp_config_req ( +void rrc_pdcp_config_req ( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, const uint32_t actionP, const rb_id_t rb_idP, - const uint8_t security_modeP);) + const uint8_t security_modeP); /*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list) * \brief Function for RRC to configure a Radio Bearer. @@ -318,8 +290,7 @@ public_pdcp(void rrc_pdcp_config_req ( * \param[in] defaultDRB Default DRB ID * \return A status about the processing, OK or error code. */ -public_pdcp( - boolean_t rrc_pdcp_config_asn1_req ( +boolean_t rrc_pdcp_config_asn1_req ( const protocol_ctxt_t* const ctxt_pP, SRB_ToAddModList_t *const srb2add_list, DRB_ToAddModList_t *const drb2add_list, @@ -332,7 +303,7 @@ public_pdcp( ,PMCH_InfoList_r9_t *pmch_InfoList_r9 #endif ,rb_id_t *const defaultDRB - )); + ); /*! \fn boolean_t pdcp_config_req_asn1 (const protocol_ctxt_t* const ctxt_pP, srb_flag_t srb_flagP, uint32_t action, rb_id_t rb_id, uint8_t rb_sn, uint8_t rb_report, uint16_t header_compression_profile, uint8_t security_mode) * \brief Function for RRC to configure a Radio Bearer. @@ -354,7 +325,7 @@ public_pdcp( * \param[in] kUPenc User-Plane encryption key * \return A status about the processing, OK or error code. */ -public_pdcp(boolean_t pdcp_config_req_asn1 ( +boolean_t pdcp_config_req_asn1 ( const protocol_ctxt_t* const ctxt_pP, pdcp_t *const pdcp_pP, const srb_flag_t srb_flagP, @@ -369,22 +340,22 @@ public_pdcp(boolean_t pdcp_config_req_asn1 ( const uint8_t security_mode, uint8_t *const kRRCenc, uint8_t *const kRRCint, - uint8_t *const kUPenc)); + uint8_t *const kUPenc); /*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP) * \brief Function (for RRC) to add a new UE in PDCP module * \param[in] ctxt_pP Running context. * \return A status about the processing, OK or error code. */ -public_pdcp(void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)); +void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP); /*! \fn boolean_t pdcp_remove_UE(const protocol_ctxt_t* const ctxt_pP) * \brief Function for RRC to remove UE from PDCP module hashtable * \param[in] ctxt_pP Running context. * \return A status about the processing, OK or error code. */ -public_pdcp(boolean_t pdcp_remove_UE( - const protocol_ctxt_t* const ctxt_pP)); +boolean_t pdcp_remove_UE( + const protocol_ctxt_t* const ctxt_pP); /*! \fn void rrc_pdcp_config_release( const protocol_ctxt_t* const, rb_id_t) * \brief This functions is unused @@ -394,7 +365,7 @@ public_pdcp(boolean_t pdcp_remove_UE( * \note None * @ingroup _pdcp */ -//public_pdcp(void rrc_pdcp_config_release ( const protocol_ctxt_t* const ctxt_pP, rb_id_t);) +//void rrc_pdcp_config_release ( const protocol_ctxt_t* const ctxt_pP, rb_id_t); /*! \fn void pdcp_run(const protocol_ctxt_t* const ctxt_pP) * \brief Runs PDCP entity to let it handle incoming/outgoing SDUs @@ -403,27 +374,23 @@ public_pdcp(boolean_t pdcp_remove_UE( * \note None * @ingroup _pdcp */ -public_pdcp(void pdcp_run ( - const protocol_ctxt_t* const ctxt_pP);) -public_pdcp(int pdcp_module_init (void);) -public_pdcp(void pdcp_module_cleanup (void);) -public_pdcp(void pdcp_layer_init (void);) -public_pdcp(void pdcp_layer_cleanup (void);) +void pdcp_run ( + const protocol_ctxt_t* const ctxt_pP); +int pdcp_module_init (void); +void pdcp_module_cleanup (void); +void pdcp_layer_init (void); +void pdcp_layer_cleanup (void); #if defined(PDCP_USE_NETLINK_QUEUES) -public_pdcp(int pdcp_netlink_init (void);) +int pdcp_netlink_init (void); #endif #define PDCP2NW_DRIVER_FIFO 21 #define NW_DRIVER2PDCP_FIFO 22 -protected_pdcp_fifo(int pdcp_fifo_flush_sdus ( - const protocol_ctxt_t* const ctxt_pP);) -protected_pdcp_fifo(int pdcp_fifo_read_input_sdus_remaining_bytes ( - const protocol_ctxt_t* const ctxt_pP);) -protected_pdcp_fifo(int pdcp_fifo_read_input_sdus ( - const protocol_ctxt_t* const ctxt_pP);) -protected_pdcp_fifo(void pdcp_fifo_read_input_sdus_from_otg ( - const protocol_ctxt_t* const ctxt_pP);) +int pdcp_fifo_flush_sdus ( const protocol_ctxt_t* const ctxt_pP); +int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t* const ctxt_pP); +int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t* const ctxt_pP); +void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t* const ctxt_pP); //----------------------------------------------------------------------------- @@ -520,31 +487,31 @@ typedef struct { #define PDCP_SN_12BIT 12 -protected_pdcp(signed int pdcp_2_nas_irq;) -public_pdcp(pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB];) -public_pdcp(pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];) -//protected_pdcp(pdcp_t pdcp_array_srb_ue[MAX_MOBILES_PER_ENB][2];) -//protected_pdcp(pdcp_t pdcp_array_drb_ue[MAX_MOBILES_PER_ENB][maxDRB];) -//public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][2];) -//protected_pdcp(pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][maxDRB];) +signed int pdcp_2_nas_irq; +pdcp_stats_t UE_pdcp_stats[MAX_MOBILES_PER_ENB]; +pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX]; +//pdcp_t pdcp_array_srb_ue[MAX_MOBILES_PER_ENB][2]; +//pdcp_t pdcp_array_drb_ue[MAX_MOBILES_PER_ENB][maxDRB]; +//pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][2]; +//pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][MAX_MOBILES_PER_ENB][maxDRB]; // for UE code conly -protected_pdcp(rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];) -protected_pdcp(rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB];) // for noS1 mode -protected_pdcp(unsigned int pdcp_eNB_UE_instance_to_rnti_index;) +rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB]; +rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode +unsigned int pdcp_eNB_UE_instance_to_rnti_index; #if (RRC_VERSION >= MAKE_VERSION(10, 0, 0)) -public_pdcp(pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -public_pdcp(pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +pdcp_mbms_t pdcp_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h #endif -protected_pdcp(sdu_size_t pdcp_output_sdu_bytes_to_write;) -protected_pdcp(sdu_size_t pdcp_output_header_bytes_to_write;) -protected_pdcp(list_t pdcp_sdu_list;) -protected_pdcp(int pdcp_sent_a_sdu;) -protected_pdcp(pdcp_data_req_header_t pdcp_input_header;) -protected_pdcp(unsigned char pdcp_input_sdu_buffer[MAX_IP_PACKET_SIZE];) -protected_pdcp(sdu_size_t pdcp_input_index_header;) -protected_pdcp(sdu_size_t pdcp_input_sdu_size_read;) -protected_pdcp(sdu_size_t pdcp_input_sdu_remaining_size_to_read;) +sdu_size_t pdcp_output_sdu_bytes_to_write; +sdu_size_t pdcp_output_header_bytes_to_write; +list_t pdcp_sdu_list; +int pdcp_sent_a_sdu; +pdcp_data_req_header_t pdcp_input_header; +unsigned char pdcp_input_sdu_buffer[MAX_IP_PACKET_SIZE]; +sdu_size_t pdcp_input_index_header; +sdu_size_t pdcp_input_sdu_size_read; +sdu_size_t pdcp_input_sdu_remaining_size_to_read; #define PDCP_COLL_KEY_VALUE(mODULE_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \ ((hash_key_t)mODULE_iD | \ @@ -575,7 +542,7 @@ protected_pdcp(sdu_size_t pdcp_input_sdu_remaining_size_to_read;) (((hash_key_t)(sESSION_ID)) << 37) | \ (((hash_key_t)(0x0000000000000001)) << 63)) -public_pdcp(hash_table_t *pdcp_coll_p;) +hash_table_t *pdcp_coll_p; #endif /*@}*/ diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c index 7af03529645a1415d76c934919020bc8800ac4c1..6951b27074877ae845ab5f74294b8c89b65765a2 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c @@ -200,7 +200,7 @@ void config_req_rlc_am ( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, - rlc_am_info_t * const config_am_pP, + const rlc_am_info_t * config_am_pP, const rb_id_t rb_idP, const logical_chan_id_t chan_idP ) diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h index 040145f7f03c1da8db15b77f979d0c155ef9e1cf..952082187e576ae3ae7fe7ecaf5bfa4f93002ee4 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h @@ -35,21 +35,6 @@ # ifndef __RLC_AM_H__ # define __RLC_AM_H__ -# ifdef RLC_AM_C -# define private_rlc_am(x) -# define protected_rlc_am(x) -# define public_rlc_am(x) -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am(x) -# define protected_rlc_am(x) extern x -# define public_rlc_am(x) extern x -# else -# define private_rlc_am(x) -# define protected_rlc_am(x) -# define public_rlc_am(x) extern x -# endif -# endif # include "platform_types.h" # include "rlc_def.h" # include "rlc_def_lte.h" @@ -117,9 +102,9 @@ * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -public_rlc_am(void rlc_am_release ( +void rlc_am_release ( const protocol_ctxt_t* const ctxtP, - rlc_am_entity_t * const rlc_pP);) + rlc_am_entity_t * const rlc_pP); /** @addtogroup _rlc_am_init_impl_ * @{ @@ -133,12 +118,14 @@ public_rlc_am(void rlc_am_release ( * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_am(void config_req_rlc_am ( - const protocol_ctxt_t* const ctxtP, - const srb_flag_t srb_flagP, - const rlc_am_info_t * const config_amP, - const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) +void +config_req_rlc_am ( + const protocol_ctxt_t* const ctxt_pP, + const srb_flag_t srb_flagP, + const rlc_am_info_t * config_am_pP, + const rb_id_t rb_idP, + const logical_chan_id_t chan_idP +); /*! \fn void config_req_rlc_am_asn1 (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, struct RLC_Config__am * config_amP, rb_id_t rb_idP, logical_chan_id_t chan_idP) * \brief Configure the UL and DL parameters of the RLC AM with the asn1c autogenerated pameters structs @@ -148,12 +135,12 @@ public_rlc_am(void config_req_rlc_am ( * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_am(void config_req_rlc_am_asn1 ( +void config_req_rlc_am_asn1 ( const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const struct RLC_Config__am * const config_amP, const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) + const logical_chan_id_t chan_idP); /** @} */ @@ -218,7 +205,7 @@ public_rlc_am(void config_req_rlc_am_asn1 ( * \param[out] stat_timer_poll_retransmit_timed_out Number of times the timer "poll_retransmit" has timed-out. * \param[out] stat_timer_status_prohibit_timed_out Number of times the timer "status_prohibit" has timed-out. */ -public_rlc_am(void rlc_am_stat_req ( +void rlc_am_stat_req ( const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, unsigned int* stat_tx_pdcp_sdu, @@ -247,14 +234,18 @@ public_rlc_am(void rlc_am_stat_req ( unsigned int* stat_rx_control_bytes, unsigned int* stat_timer_reordering_timed_out, unsigned int* stat_timer_poll_retransmit_timed_out, - unsigned int* stat_timer_status_prohibit_timed_out);) + unsigned int* stat_timer_status_prohibit_timed_out); /*! \fn void rlc_am_get_pdus (const protocol_ctxt_t* const ctxtP, void * const rlc_pP) * \brief Request the segmentation of SDUs based on status previously sent by MAC. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -private_rlc_am( void rlc_am_get_pdus (const protocol_ctxt_t* const ctxtP,void * const rlc_pP);) +void +rlc_am_get_pdus ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t * const rlc_pP +); /*! \fn void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indication) * \brief Process the received PDUs from lower layer. @@ -262,7 +253,7 @@ private_rlc_am( void rlc_am_get_pdus (const protocol_ctxt_t* const ctxtP,v * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] data_indication PDUs from MAC. */ -protected_rlc_am( void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind);) +void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind); /*! \fn struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP) * \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission. @@ -273,14 +264,14 @@ protected_rlc_am( void rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * * \param[in] enb_flagP eNB or UE flag indication. * \return The maximum number of bytes that can be served by RLC instance to MAC. */ -public_rlc_am( struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);) +struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP); /*! \fn void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP) * \brief Set available TBS for RLC Tx just before am_mac_data_request. Used for UE only. * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] tb_sizeP Available Tx Transport Block size in bytes. */ -public_rlc_am( void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP);) +void rlc_am_set_nb_bytes_requested_by_mac (void * const rlc_pP,const tb_size_t tb_sizeP); /*! \fn struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t enb_flagP) * \brief Gives PDUs to lower layer MAC. @@ -289,7 +280,7 @@ public_rlc_am( void rlc_am_set_nb_bytes_requested_by_mac (void * const * \param[in] enb_flagP eNB or UE flag * \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission. */ -public_rlc_am( struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t enb_flagP);) +struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t enb_flagP); /*! \fn void rlc_am_mac_data_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indP) * \brief Receive PDUs from lower layer MAC. @@ -297,14 +288,14 @@ public_rlc_am( struct mac_data_req rlc_am_mac_data_request (const protocol_ct * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] data_indP PDUs from MAC. */ -public_rlc_am( void rlc_am_mac_data_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indP);) +void rlc_am_mac_data_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indP); /*! \fn uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP) * \brief Get Tx Buffer Occupancy. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -public_rlc_am( uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP);) +uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP); /*! \fn void rlc_am_data_req (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, mem_block_t *sduP) * \brief Interface with higher layers, buffer higher layer SDUS for transmission. @@ -312,6 +303,6 @@ public_rlc_am( uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] sduP SDU. (A struct rlc_am_data_req is mapped on sduP->data.) */ -public_rlc_am( void rlc_am_data_req (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, mem_block_t *sduP);) +void rlc_am_data_req (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, mem_block_t *sduP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h index 43503a1b3a014169ddcc2741044f2cf2e2a385fa..bc97490c905991cc30c69b350d59682877e0e77f 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h @@ -34,22 +34,6 @@ */ # ifndef __RLC_AM_IN_SDU_H__ # define __RLC_AM_IN_SDU_H__ -//----------------------------------------------------------------------------- -# ifdef RLC_AM_IN_SDU_C -# define private_rlc_am_in_sdu(x) x -# define protected_rlc_am_in_sdu(x) x -# define public_rlc_am_in_sdu(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_in_sdu(x) -# define protected_rlc_am_in_sdu(x) extern x -# define public_rlc_am_in_sdu(x) extern x -# else -# define private_rlc_am_in_sdu(x) -# define protected_rlc_am_in_sdu(x) -# define public_rlc_am_in_sdu(x) extern x -# endif -# endif /*! \fn void rlc_am_free_in_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP) * \brief Free a higher layer SDU stored in input_sdus[] buffer. * \param[in] ctxtP Running context. @@ -57,7 +41,7 @@ * \param[in] index_in_bufferP Position index of the SDU. * \note Update also the RLC AM instance variables nb_sdu, current_sdu_index, nb_sdu_no_segmented. */ -protected_rlc_am_in_sdu(void rlc_am_free_in_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP);) +void rlc_am_free_in_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP); /*! \fn void rlc_am_free_in_sdu_data (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP) @@ -67,7 +51,7 @@ protected_rlc_am_in_sdu(void rlc_am_free_in_sdu (const protocol_ctxt_t* con * \param[in] index_in_bufferP Position index of the SDU. * \note This procedure is called when the SDU segmentation is done for this SDU. Update also the RLC AM instance variable nb_sdu_no_segmented. */ -protected_rlc_am_in_sdu(void rlc_am_free_in_sdu_data (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP);) +void rlc_am_free_in_sdu_data (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, unsigned int index_in_bufferP); /*! \fn signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP) @@ -76,7 +60,7 @@ protected_rlc_am_in_sdu(void rlc_am_free_in_sdu_data (const protocol_ctxt_t* con * \param[in] rlcP RLC AM protocol instance pointer. * \return 1 if the buffer is empty, else 0. */ -protected_rlc_am_in_sdu(signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP);) +signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP); /*! \fn void rlc_am_pdu_sdu_data_cnf(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,const rlc_sn_t snP) * \brief Process SDU cnf of a ACKED PDU for all SDUs concatenated in this PDU. @@ -84,6 +68,6 @@ protected_rlc_am_in_sdu(signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] snP Sequence number of the PDU. */ -protected_rlc_am_in_sdu(void rlc_am_pdu_sdu_data_cnf(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,const rlc_sn_t snP);) +void rlc_am_pdu_sdu_data_cnf(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,const rlc_sn_t snP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h index c69fd3766e4554e043598825f3f61ca68b3de987..9de54cd3d5becdd81a4f950159e696ed08ff4e38 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.h @@ -37,21 +37,6 @@ # include "UTIL/MEM/mem_block.h" //----------------------------------------------------------------------------- -# ifdef RLC_AM_INIT_C -# define private_rlc_am_init(x) x -# define protected_rlc_am_init(x) x -# define public_rlc_am_init(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_init(x) -# define protected_rlc_am_init(x) extern x -# define public_rlc_am_init(x) extern x -# else -# define private_rlc_am_init(x) -# define protected_rlc_am_init(x) -# define public_rlc_am_init(x) extern x -# endif -# endif //----------------------------------------------------------------------------- #include "platform_types.h" #include "platform_constants.h" @@ -76,13 +61,13 @@ typedef volatile struct { * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -public_rlc_am_init( void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP);) +void rlc_am_init (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t* rlc_pP); /*! \fn void rlc_am_cleanup(rlc_am_entity_t *const rlc_pP) * \brief Free all memory resources allocated and kept by this RLC AM instance. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -public_rlc_am_init( void rlc_am_cleanup(rlc_am_entity_t* rlc_pP);) +void rlc_am_cleanup(rlc_am_entity_t* rlc_pP); /*! \fn void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint16_t max_retx_thresholdP, uint16_t poll_pduP, uint16_t poll_byteP, uint32_t t_poll_retransmitP, uint32_t t_reorderingP, uint32_t t_status_prohibitP) * \brief Set RLC AM protocol parameters. @@ -96,14 +81,14 @@ AMD PDU. * \param[in] t_reorderingP This timer is used by the receiving side of an AM RLC entity in order to detect loss of RLC PDUs at lower layer, value in frames. * \param[in] t_status_prohibitP This timer is used by the receiving side of an AM RLC entity in order to prohibit transmission of a STATUS PDU, value in frames. */ -public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP, +void rlc_am_configure(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const uint16_t max_retx_thresholdP, const uint16_t poll_pduP, const uint16_t poll_byteP, const uint32_t t_poll_retransmitP, const uint32_t t_reorderingP, - const uint32_t t_status_prohibitP);) + const uint32_t t_status_prohibitP); /*! \fn void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP) @@ -114,6 +99,6 @@ public_rlc_am_init( void rlc_am_configure(const protocol_ctxt_t* const ctxtP, * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_am_init( void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, const logical_chan_id_t chan_idP);) +void rlc_am_set_debug_infos(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, const logical_chan_id_t chan_idP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h index 82148a4a377899c4a98c5b0a2909e79764a3d846..bf9bd58fb52887b4b2f1cfdd08b2c1fe44bce3a3 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h @@ -34,27 +34,12 @@ */ #ifndef __RLC_AM_REASSEMBLY_H__ # define __RLC_AM_REASSEMBLY_H__ -# ifdef RLC_AM_REASSEMBLY_C -# define private_rlc_am_reassembly(x) x -# define protected_rlc_am_reassembly(x) x -# define public_rlc_am_reassembly(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_reassembly(x) -# define protected_rlc_am_reassembly(x) extern x -# define public_rlc_am_reassembly(x) extern x -# else -# define private_rlc_am_reassembly(x) -# define protected_rlc_am_reassembly(x) -# define public_rlc_am_reassembly(x) extern x -# endif -# endif /*! \fn void rlc_am_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP) * \brief Reset the data cursor index in the output SDU buffer to zero. * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -private_rlc_am_reassembly( void rlc_am_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);) +void rlc_am_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP); /*! \fn void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pPuint8_t * srcP, int32_t lengthP) * \brief Concatenate datas at the tail of the output SDU in construction. This SDU in construction will be sent to higher layer. @@ -63,14 +48,14 @@ private_rlc_am_reassembly( void rlc_am_clear_rx_sdu (const protocol_ctxt_t* co * \param[in] srcP Pointer on data to be reassemblied. * \param[in] lengthP Length of data to be reassemblied. */ -private_rlc_am_reassembly( void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint8_t * srcP, int32_t lengthP);) +void rlc_am_reassembly (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, uint8_t * srcP, int32_t lengthP); /*! \fn void rlc_am_send_sdu (rlc_am_entity_t *rlc_pP,frame_t frameP) * \brief Send the output SDU in construction to higher layer. * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -private_rlc_am_reassembly( void rlc_am_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);) +void rlc_am_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP); /*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const mem_block_t* const tb_pP,boolean_t free_rlc_pdu) * \brief Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header. @@ -79,7 +64,7 @@ private_rlc_am_reassembly( void rlc_am_send_sdu (const protocol_ctxt_t* co * \param[in] tb_pP RLC AM PDU embedded in a mem_block_t. * \param[in] free_rlc_pdu Flag for freeing RLC AM PDU after reassembly. */ -protected_rlc_am_reassembly( void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP,boolean_t free_rlc_pdu);) +void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP,boolean_t free_rlc_pdu); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.h index 9d2978b0f8a6566cef8418f0a112b2c489767e37..fdbd95873d3a6ee3c8c5a3a0253903aa79fd9a2d 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.h @@ -34,21 +34,6 @@ */ # ifndef __RLC_AM_RECEIVER_H__ # define __RLC_AM_RECEIVER_H__ -# ifdef RLC_AM_RECEIVER_C -# define private_rlc_am_receiver(x) x -# define protected_rlc_am_receiver(x) x -# define public_rlc_am_receiver(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_receiver(x) -# define protected_rlc_am_receiver(x) extern x -# define public_rlc_am_receiver(x) extern x -# else -# define private_rlc_am_receiver(x) -# define protected_rlc_am_receiver(x) -# define public_rlc_am_receiver(x) extern x -# endif -# endif /*! \fn signed int rlc_am_get_data_pdu_infos( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t * const rlc_pP,rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, rlc_am_pdu_info_t* pdu_infoP) * \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU. * \param[in] ctxt_pP Running context. @@ -58,12 +43,12 @@ * \param[in] pdu_infoP Structure containing extracted informations from PDU. * \return 0 if no error was encountered during the parsing of the PDU, else -1; */ -protected_rlc_am_receiver( signed int rlc_am_get_data_pdu_infos( +signed int rlc_am_get_data_pdu_infos( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t * const rlc_pP, rlc_am_pdu_sn_10_t* headerP, int16_t sizeP, - rlc_am_pdu_info_t* pdu_infoP)); + rlc_am_pdu_info_t* pdu_infoP); /*! \fn void rlc_am_display_data_pdu_infos(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, rlc_am_pdu_info_t* pdu_infoP) * \brief Display RLC AM PDU informations. @@ -71,7 +56,7 @@ protected_rlc_am_receiver( signed int rlc_am_get_data_pdu_infos( * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] pdu_infoP Structure containing extracted informations of a PDU. */ -protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t * const rlc_pP, rlc_am_pdu_info_t* pdu_infoP);) +void rlc_am_display_data_pdu_infos(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t * const rlc_pP, rlc_am_pdu_info_t* pdu_infoP); /*! \fn void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP) * \brief Update RLC AM protocol variable VR(MS). @@ -80,7 +65,7 @@ protected_rlc_am_receiver( void rlc_am_display_data_pdu_infos(const protocol_ctx * \param[in] tb_pP PDU embedded in a mem_block_t struct. * \note It is assumed that the sequence number of the transport block is equal to VR(MS) */ -protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP);) +void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP); /*! \fn void rlc_am_rx_update_vr_r (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP,mem_block_t* tb_pP) * \brief Update RLC AM protocol variable VR(R). @@ -89,7 +74,7 @@ protected_rlc_am_receiver( void rlc_am_rx_update_vr_ms(const protocol_ctxt_t* co * \param[in] tb_pP PDU embedded in a mem_block_t struct. * \note It is assumed that the sequence number of the transport block is equal to VR(R) */ -protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP);) +void rlc_am_rx_update_vr_r (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP); /*! \fn void rlc_am_receive_routing (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, struct mac_data_ind data_indP) * \brief Convert transport blocks received from MAC layer into RLC AM PDUs, and dispatch to the right processing block these PDUS upon their type (CONTROL/DATA). @@ -97,7 +82,7 @@ protected_rlc_am_receiver( void rlc_am_rx_update_vr_r (const protocol_ctxt_t* co * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] data_indP Transport blocks received from MAC layer. */ -protected_rlc_am_receiver( void rlc_am_receive_routing (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, struct mac_data_ind data_indP)); +void rlc_am_receive_routing (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, struct mac_data_ind data_indP); /*! \fn void rlc_am_receive_process_data_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP, uint8_t* first_byteP, uint16_t tb_size_in_bytesP) * \brief Process an incoming data PDU received from MAC layer. @@ -107,7 +92,7 @@ protected_rlc_am_receiver( void rlc_am_receive_routing (const protocol_ctxt_t* c * \param[in] first_byteP Pointer on first byte of the PDU. * \param[in] tb_size_in_bytesP Transport block size in bytes (same as PDU size in bytes). */ -private_rlc_am_receiver( void rlc_am_receive_process_data_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP, uint8_t* first_byteP, - uint16_t tb_size_in_bytesP)); +void rlc_am_receive_process_data_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlc_pP, mem_block_t* tb_pP, uint8_t* first_byteP, + uint16_t tb_size_in_bytesP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h index bbd69910baac2c08530f720ae1696c2973a338b5..fc5268931420556c41a4f0ca2af8d25d38f29bad 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h @@ -35,21 +35,6 @@ # ifndef __RLC_AM_RETRANSMIT_H__ # define __RLC_AM_RETRANSMIT_H__ //----------------------------------------------------------------------------- -# ifdef RLC_AM_RETRANSMIT_C -# define private_rlc_am_retransmit(x) x -# define protected_rlc_am_retransmit(x) x -# define public_rlc_am_retransmit(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_retransmit(x) -# define protected_rlc_am_retransmit(x) extern x -# define public_rlc_am_retransmit(x) extern x -# else -# define private_rlc_am_retransmit(x) -# define protected_rlc_am_retransmit(x) -# define public_rlc_am_retransmit(x) extern x -# endif -# endif /*! \fn boolean_t rlc_am_nack_pdu (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, int16_t snP, int16_t prev_nack_snP,sdu_size_t so_startP, sdu_size_t so_endP) * \brief The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields. * \param[in] ctxtP Running context. @@ -61,13 +46,13 @@ * \return OK/KO * \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU. */ -protected_rlc_am_retransmit(boolean_t rlc_am_nack_pdu ( +boolean_t rlc_am_nack_pdu ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, const rlc_sn_t snP, const rlc_sn_t prev_nack_snP, sdu_size_t so_startP, - sdu_size_t so_endP);) + sdu_size_t so_endP); /*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP) * \brief The RLC AM PDU which have the sequence number snP is marked ACKed. @@ -77,11 +62,11 @@ protected_rlc_am_retransmit(boolean_t rlc_am_nack_pdu ( * \param[in] free_pdu Boolean indicating that the PDU can be freed because smaller than new vtA. * \note Depending on the state of the retransmission buffer, positive confirmation can be sent to higher layers about the receiving by the peer RLC AM instance of a particular SDU. */ -protected_rlc_am_retransmit(void rlc_am_ack_pdu ( +void rlc_am_ack_pdu ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, const rlc_sn_t snP, - boolean_t free_pdu);) + boolean_t free_pdu); /*! \fn mem_block_t* rlc_am_retransmit_get_copy (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *rlcP, rlc_sn_t snP) * \brief The RLC AM PDU which have the sequence number snP is marked ACKed. @@ -90,29 +75,51 @@ protected_rlc_am_retransmit(void rlc_am_ack_pdu ( * \param[in] snP Sequence number of the PDU to be copied. * \return A copy of the PDU having sequence number equal to parameter snP. */ -protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy ( +mem_block_t* rlc_am_retransmit_get_copy ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, - const rlc_sn_t snP)); - + const rlc_sn_t snP); +/*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *rlcP,rlc_sn_t snP, sdu_size_t *sizeP) +* \brief The RLC AM PDU which have the sequence number snP is marked ACKed. +* \param[in] ctxtP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] snP Sequence number of the PDU to be copied. +* \param[in,out] sizeP Maximum size allowed for the subsegment, it is updated with the amount of bytes not used (sizeP[out] = sizeP[in] - size of segment). +* \return A copy of a segment of the PDU having sequence number equal to parameter snP. +*/ +mem_block_t* rlc_am_retransmit_get_subsegment ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t *const rlcP, + const rlc_sn_t snP, + sdu_size_t *const sizeP); /*! \fn mem_block_t* rlc_am_get_pdu_to_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* rlcP) * \brief Find a PDU or PDU segment to retransmit. * \param[in] ctxtP Running context. * \param[in] rlcP RLC AM protocol instance pointer. * \return A copy of the retransmitted PDU or PDU segment or NULL if TBS was not big enough */ -protected_rlc_am_retransmit(mem_block_t* rlc_am_get_pdu_to_retransmit( +mem_block_t* rlc_am_get_pdu_to_retransmit( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlcP);) + + rlc_am_entity_t* const rlcP); +/*! \fn void rlc_am_retransmit_any_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* rlcP) +* \brief Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU. +* \param[in] ctxtP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +*/ +void rlc_am_retransmit_any_pdu( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t* const rlcP); + /*! \fn void rlc_am_tx_buffer_display (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* rlcP, char* message_pP) * \brief Display the dump of the retransmission buffer. * \param[in] ctxtP Running context. * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] message_pP Message to be displayed along with the display of the dump of the retransmission buffer. */ -protected_rlc_am_retransmit(void rlc_am_tx_buffer_display ( +void rlc_am_tx_buffer_display ( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, - char* const message_pP);) + char* const message_pP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h index b02befdab845a6b0e123110f31f118ba0763009a..fd8704964d1a5fd0f752f0454f80a4ffafb604a6 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h @@ -38,22 +38,6 @@ # include "UTIL/MEM/mem_block.h" //----------------------------------------------------------------------------- -# ifdef RLC_AM_RX_LIST_C -# define private_rlc_am_rx_list(x) x -# define protected_rlc_am_rx_list(x) x -# define public_rlc_am_rx_list(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_rx_list(x) -# define protected_rlc_am_rx_list(x) extern x -# define public_rlc_am_rx_list(x) extern x -# else -# define private_rlc_am_rx_list(x) -# define protected_rlc_am_rx_list(x) -# define public_rlc_am_rx_list(x) extern x -# endif -# endif -//----------------------------------------------------------------------------- #include "platform_types.h" #include "platform_constants.h" //#include "PHY/defs.h" @@ -66,7 +50,16 @@ * \param[in] tbP A PDU embedded in a mem_block_t. * \return Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted. */ -protected_rlc_am_rx_list( rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP);) +rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP); + +/*! \fn signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP , mem_block_t* const tbP) +* \brief Insert a PDU in the RX buffer (implemented with a list). +* \param[in] ctxt_pP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] tbP A PDU embedded in a mem_block_t. +* \return Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted. +*/ +signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP); /*! \fn boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP) * \brief Check if reassembly taking into account potential new vrR value @@ -74,7 +67,7 @@ protected_rlc_am_rx_list( rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_ * \param[in] rlcP RLC AM protocol instance pointer. * \return TRUE if reassembly must be done, FALSE else */ -protected_rlc_am_rx_list( boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP);) +boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP) * \brief Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure. @@ -82,7 +75,7 @@ protected_rlc_am_rx_list( boolean_t rlc_am_rx_check_vr_reassemble(const protocol * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] tbP A PDU embedded in a mem_block_t. */ -protected_rlc_am_rx_list( void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP);) +void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP); /*! \fn void rlc_am_rx_mark_all_segments_received (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const first_segment_tbP) * \brief Mark all PDUs having the same sequence number as first_segment_tbP with the information that all segments have been received. @@ -90,14 +83,14 @@ protected_rlc_am_rx_list( void rlc_am_rx_check_all_byte_segments(const protocol_ * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] first_segment_tbP A PDU embedded in a mem_block_t, it is the first PDU in the RX buffer (list) that have its sequence number. */ -protected_rlc_am_rx_list( void rlc_am_rx_mark_all_segments_received(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const first_segment_tbP);) +void rlc_am_rx_mark_all_segments_received(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const first_segment_tbP); /*! \fn void rlc_am_rx_list_reassemble_rlc_sdus(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP) * \brief Reassembly all SDUS that it is possible to reassembly by parsing the RX buffer and looking for PDUs having the flag 'all segments received'. * \param[in] ctxt_pP Running context. * \param[in] rlcP RLC AM protocol instance pointer. */ -protected_rlc_am_rx_list( void rlc_am_rx_list_reassemble_rlc_sdus(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP);) +void rlc_am_rx_list_reassemble_rlc_sdus(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP); /*! \fn mem_block_t* list2_insert_before_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP) * \brief Insert a PDU embedded in a mem_block_t in a list at a position before a designated element of the list. @@ -105,7 +98,7 @@ protected_rlc_am_rx_list( void rlc_am_rx_list_reassemble_rlc_sdus(const protocol * \param[in] elementP Element in the list. * \param[in] listP List where elements are linked. */ -public_rlc_am_rx_list( mem_block_t* list2_insert_before_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP);) +mem_block_t* list2_insert_before_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP); /*! \fn mem_block_t* list2_insert_after_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP) * \brief Insert a PDU embedded in a mem_block_t in a list at a position after a designated element of the list. @@ -113,13 +106,13 @@ public_rlc_am_rx_list( mem_block_t* list2_insert_before_element (mem_block_t * e * \param[in] elementP Element in the list. * \param[in] listP List where elements are linked. */ -public_rlc_am_rx_list( mem_block_t* list2_insert_after_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP);) +mem_block_t* list2_insert_after_element (mem_block_t * element_to_insertP, mem_block_t * elementP, list2_t * listP); /*! \fn void rlc_am_rx_list_display (const rlc_am_entity_t* const rlcP, char* messageP) * \brief Display the dump of the RX buffer. * \param[in] rlcP RLC AM protocol instance pointer. * \param[in] messageP Message to be displayed along with the display of the dump of the RX buffer. */ -protected_rlc_am_rx_list( void rlc_am_rx_list_display (const rlc_am_entity_t* const rlcP, char* messageP);) +void rlc_am_rx_list_display (const rlc_am_entity_t* const rlcP, char* messageP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h index aa5cb6dceb25ecd00576cea224b1eca1b9909007..dc754d08e498b61024e00dffd194c4a4aa44da5e 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h @@ -35,21 +35,6 @@ # ifndef __RLC_AM_SEGMENT_H__ # define __RLC_AM_SEGMENT_H__ //----------------------------------------------------------------------------- -# ifdef RLC_AM_SEGMENT_C -# define private_rlc_am_segment(x) x -# define protected_rlc_am_segment(x) x -# define public_rlc_am_segment(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_segment(x) -# define protected_rlc_am_segment(x) extern x -# define public_rlc_am_segment(x) extern x -# else -# define private_rlc_am_segment(x) -# define protected_rlc_am_segment(x) -# define public_rlc_am_segment(x) extern x -# endif -# endif /*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu) * \brief Set or not the poll bit in the PDU header depending on RLC AM protocol variables. @@ -58,13 +43,13 @@ * \param[in] pduP Pointer on the header of the PDU in order to be able to set the poll bit if necessary. * \param[in] payload_sizeP Size of the payload of the PDU. */ -protected_rlc_am_segment(void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu);) +void rlc_am_pdu_polling (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu); /*! \fn void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP) * \brief Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit). * \param[in] ctxt_pP Running context. * \param[in] rlcP RLC AM protocol instance pointer. */ -protected_rlc_am_segment(void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *const rlcP);) +void rlc_am_segment_10 (const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t *const rlcP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h index 39971888c28bfe390e06a9280c2bac5a77e307ac..0b237b07f421b48dce381cee05cd18fb2d167437 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h @@ -32,5 +32,63 @@ * @ingroup _rlc_am_internal_segment_impl_ * @{ */ -/* This file is empty. Should be removed */ +#ifndef __RLC_AM_SEGMENT_HOLES_H__ +# define __RLC_AM_SEGMENT_HOLES_H__ +//----------------------------------------------------------------------------- +/*! \fn void rlc_am_clear_holes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP) +* \brief Remove all marked holes for PDU with sequence number "snP". +* \param[in] ctxt_pP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] snP Sequence number. +*/ +void rlc_am_clear_holes ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t *const rlcP, + const rlc_sn_t snP); + +/*! \fn void rlc_am_remove_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP) +* \brief Remove for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. +* \param[in] ctxt_pP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] snP Sequence number. +* \param[in] so_startP Start of segment offset. +* \param[in] so_stopP End of segment offset. +*/ +void rlc_am_remove_hole ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t *const rlcP, + const rlc_sn_t snP, + const sdu_size_t so_startP, + const sdu_size_t so_stopP); +/*! \fn void rlc_am_get_next_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t* so_startP, sdu_size_t* so_stopP) +* \brief Get for PDU with sequence number "snP" the first hole start and stop parameters. +* \param[in] ctxt_pP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] snP Sequence number. +* \param[in,out] so_startP Start of segment offset. +* \param[in,out] so_stopP End of segment offset. +*/ +void rlc_am_get_next_hole ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t *const rlcP, + const rlc_sn_t snP, + sdu_size_t* const so_startP, + sdu_size_t* const so_stopP); + +/*! \fn void rlc_am_add_hole (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const rlcP, rlc_sn_t snP, sdu_size_t so_startP, sdu_size_t so_stopP) +* \brief Mark for PDU with sequence number "snP" a NACK for byte segment offset [so_startP, so_stopP]. +* \param[in] ctxt_pP Running context. +* \param[in] rlcP RLC AM protocol instance pointer. +* \param[in] snP Sequence number. +* \param[in,out] so_startP Start of segment offset. +* \param[in,out] so_stopP End of segment offset. +*/ +void rlc_am_add_hole ( + const protocol_ctxt_t* const ctxt_pP, + rlc_am_entity_t *const rlcP, + const rlc_sn_t snP, + const sdu_size_t so_startP, + sdu_size_t so_stopP); +/** @} */ +#endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h index 41f214d7c6cc54c87d4fcc6b5aefeece7ebd6efc..a84b25c8e5675c87807add446945c93a250bafd0 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.h @@ -37,21 +37,6 @@ # include "UTIL/MEM/mem_block.h" //----------------------------------------------------------------------------- -# ifdef RLC_AM_STATUS_REPORT_C -# define private_rlc_am_status_report(x) x -# define protected_rlc_am_status_report(x) x -# define public_rlc_am_status_report(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_status_report(x) -# define protected_rlc_am_status_report(x) extern x -# define public_rlc_am_status_report(x) extern x -# else -# define private_rlc_am_status_report(x) -# define protected_rlc_am_status_report(x) -# define public_rlc_am_status_report(x) extern x -# endif -# endif //----------------------------------------------------------------------------- #include "platform_types.h" #include "platform_constants.h" @@ -65,7 +50,7 @@ * \param[in] bits_to_readP Number of bits to read (max 16). * \return Value read on 16 bits, bits read are shifted to least significant bits of returned short value. */ -protected_rlc_am_status_report( uint16_t rlc_am_read_bit_field (uint8_t** dataP, unsigned int* bit_posP, const signed int bits_to_readP);) +uint16_t rlc_am_read_bit_field (uint8_t** dataP, unsigned int* bit_posP, const signed int bits_to_readP); /*! \fn void rlc_am_write8_bit_field(uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, const uint8_t valueP) * \brief Write N bits (max 8) in a byte area seen as a bit-field with the help of a byte index and a modulo 8 bit index. @@ -74,7 +59,7 @@ protected_rlc_am_status_report( uint16_t rlc_am_read_bit_field * \param[in] bits_to_writeP Number of bits to write (max 8). * \param[in] valueP Value to write. */ -protected_rlc_am_status_report(void rlc_am_write8_bit_field(uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, const uint8_t valueP);) +void rlc_am_write8_bit_field(uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, const uint8_t valueP); /*! \fn void rlc_am_write16_bit_field(uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, const uint16_t valueP) * \brief Write N bits (max 16) in a byte area seen as a bit-field with the help of a byte index and a modulo 8 bit index. @@ -83,11 +68,11 @@ protected_rlc_am_status_report(void rlc_am_write8_bit_field(uint8_t** dat * \param[in] bits_to_writeP Number of bits to write (max 16). * \param[in] valueP Value to write. */ -protected_rlc_am_status_report(void rlc_am_write16_bit_field( +void rlc_am_write16_bit_field( uint8_t** dataP, unsigned int* bit_posP, signed int bits_to_writeP, - const uint16_t valueP);) + const uint16_t valueP); /*! \fn signed int rlc_am_get_control_pdu_infos (rlc_am_pdu_sn_10_t* const headerP, sdu_size_t * const total_sizeP, rlc_am_control_pdu_info_t* const pdu_infoP) * \brief Retrieve control PDU informations from a serialized control PDU. @@ -95,16 +80,16 @@ protected_rlc_am_status_report(void rlc_am_write16_bit_field( * \param[in] total_size_pP Pointer on PDU size in bytes. * \param[in,out] pdu_infoP Struct containing interpreted PDU control informations. */ -protected_rlc_am_status_report( signed int rlc_am_get_control_pdu_infos ( +signed int rlc_am_get_control_pdu_infos ( rlc_am_pdu_sn_10_t* const headerP, sdu_size_t * const total_size_pP, - rlc_am_control_pdu_info_t* const pdu_infoP);) + rlc_am_control_pdu_info_t* const pdu_infoP); /*! \fn void rlc_am_display_control_pdu_infos(const rlc_am_control_pdu_info_t* const pdu_infoP) * \brief Dump on LOG output the informations contained in the pdu_infoP structure. * \param[in] pdu_infoP Struct containing interpreted PDU control informations. */ -protected_rlc_am_status_report( void rlc_am_display_control_pdu_infos(const rlc_am_control_pdu_info_t* const pdu_infoP);) +void rlc_am_display_control_pdu_infos(const rlc_am_control_pdu_info_t* const pdu_infoP); /*! \fn void rlc_am_receive_process_control_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, mem_block_t* const tbP, uint8_t* first_byte, const uint16_t tb_size_in_bytes) * \brief Process the informations contained in the control PDU. @@ -114,12 +99,12 @@ protected_rlc_am_status_report( void rlc_am_display_control_pdu_infos(const rlc_ * \param[in] first_byte Pointer on first byte of control PDU. * \param[in] tb_size_in_bytes Pointer on size of serialized control PDU in bytes. */ -protected_rlc_am_status_report( void rlc_am_receive_process_control_pdu( +void rlc_am_receive_process_control_pdu( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, mem_block_t* const tbP, uint8_t** first_byte, - sdu_size_t * const tb_size_in_bytes);) + sdu_size_t * const tb_size_in_bytes); /*! \fn int rlc_am_write_status_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, rlc_am_pdu_sn_10_t* const rlc_am_pdu_sn_10P, rlc_am_control_pdu_info_t* const pdu_infoP) * \brief Remove all marked holes for PDU with sequence number "snP". @@ -129,19 +114,19 @@ protected_rlc_am_status_report( void rlc_am_receive_process_control_pdu( * \param[in] pdu_infoP Struct containing PDU control informations elements. * \return The number of bytes that have been written. */ -protected_rlc_am_status_report(int rlc_am_write_status_pdu( +int rlc_am_write_status_pdu( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t *const rlc_pP, rlc_am_pdu_sn_10_t* const rlc_am_pdu_sn_10P, - rlc_am_control_pdu_info_t* const pdu_infoP);) + rlc_am_control_pdu_info_t* const pdu_infoP); /*! \fn void rlc_am_send_status_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Send a status PDU based on the receiver buffer content. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_status_report(void rlc_am_send_status_pdu( +void rlc_am_send_status_pdu( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t *const rlc_pP);) + rlc_am_entity_t *const rlc_pP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.h index b42800e15f3a3799920075dec308d34fbce530c7..6be3867b1075b74b9dbd3b43863f8404a0ce8318 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.h @@ -32,34 +32,19 @@ */ # ifndef __RLC_AM_TEST_H__ # define __RLC_AM_TEST_H__ -# ifdef RLC_AM_TEST_C -# define private_rlc_am_test(x) x -# define protected_rlc_am_test(x) x -# define public_rlc_am_test(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_test(x) -# define protected_rlc_am_test(x) extern x -# define public_rlc_am_test(x) extern x -# else -# define private_rlc_am_test(x) -# define protected_rlc_am_test(x) -# define public_rlc_am_test(x) extern x -# endif -# endif -public_rlc_am_test(rlc_am_entity_t g_am_tx;) -public_rlc_am_test(rlc_am_entity_t g_am_rx;) +rlc_am_entity_t g_am_tx; +rlc_am_entity_t g_am_rx; -protected_rlc_am_test(void rlc_am_v9_3_0_test_windows();) -protected_rlc_am_test(void rlc_am_v9_3_0_test_read_write_bit_field();) -protected_rlc_am_test(void rlc_am_v9_3_0_test_data_conf(module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP);) -protected_rlc_am_test(void rlc_am_v9_3_0_test_send_sdu(rlc_am_entity_t *am_txP, int sdu_indexP);) -protected_rlc_am_test(void rlc_am_v9_3_0_test_exchange_pdus(rlc_am_entity_t *am_txP,rlc_am_entity_t *am_RxP, - uint16_t bytes_txP,uint16_t bytes_rxP);) -protected_rlc_am_test(void rlc_am_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_data_req *data_requestP, int* drop_countP, int *tx_packetsP, int* dropped_tx_packetsP);) -protected_rlc_am_test(void rlc_am_v9_3_0_test_data_ind (module_id_t module_idP, rb_id_t rb_idP, sdu_size_t sizeP, - mem_block_t *sduP);) -protected_rlc_am_test(void rlc_am_v9_3_0_test_tx_rx();) -public_rlc_am_test( void rlc_am_v9_3_0_test_print_trace (void);) -public_rlc_am_test( void rlc_am_v9_3_0_test()); +void rlc_am_v9_3_0_test_windows(); +void rlc_am_v9_3_0_test_read_write_bit_field(); +void rlc_am_v9_3_0_test_data_conf(module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP); +void rlc_am_v9_3_0_test_send_sdu(rlc_am_entity_t *am_txP, int sdu_indexP); +void rlc_am_v9_3_0_test_exchange_pdus(rlc_am_entity_t *am_txP,rlc_am_entity_t *am_RxP, + uint16_t bytes_txP,uint16_t bytes_rxP); +void rlc_am_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_data_req *data_requestP, int* drop_countP, int *tx_packetsP, int* dropped_tx_packetsP); +void rlc_am_v9_3_0_test_data_ind (module_id_t module_idP, rb_id_t rb_idP, sdu_size_t sizeP, + mem_block_t *sduP); +void rlc_am_v9_3_0_test_tx_rx(); +void rlc_am_v9_3_0_test_print_trace (void); +void rlc_am_v9_3_0_test(); # endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.h index c5d49268c4d0f95e299eea9dfa1d066bf226e94d..5f8fd5bedc4a6fc71f2e18849cc1496d4dcf5a1e 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.h @@ -35,21 +35,6 @@ #ifndef __RLC_AM_TIMER_POLL_RETRANSMIT_H__ # define __RLC_AM_TIMER_POLL_RETRANSMIT_H__ -# ifdef RLC_AM_TIMER_POLL_RETRANSMIT_C -# define private_rlc_am_timer_poll_retransmit(x) x -# define protected_rlc_am_timer_poll_retransmit(x) x -# define public_rlc_am_timer_poll_retransmit(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_timer_poll_retransmit(x) -# define protected_rlc_am_timer_poll_retransmit(x) extern x -# define public_rlc_am_timer_poll_retransmit(x) extern x -# else -# define private_rlc_am_timer_poll_retransmit(x) -# define protected_rlc_am_timer_poll_retransmit(x) -# define public_rlc_am_timer_poll_retransmit(x) extern x -# endif -# endif /*! \fn void rlc_am_check_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Check if timer Poll-retransmit has timed-out, if so it is stopped and has the status "timed-out". @@ -57,9 +42,9 @@ * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_poll_retransmit(void rlc_am_check_timer_poll_retransmit( +void rlc_am_check_timer_poll_retransmit( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP)); + rlc_am_entity_t* const rlc_pP); /*! \fn int rlc_am_is_timer_poll_retransmit_timed_out(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Boolean function, check if timer Poll-retransmit has timed-out. @@ -67,9 +52,9 @@ protected_rlc_am_timer_poll_retransmit(void rlc_am_check_timer_poll_retransmit( * \param[in] rlc_pP RLC AM protocol instance pointer. * \return 1 if timer Poll-retransmit has timed-out, else 0. */ -protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_timed_out( +int rlc_am_is_timer_poll_retransmit_timed_out( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP);) + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_stop_and_reset_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Stop and reset the timer Poll-retransmit. @@ -77,9 +62,9 @@ protected_rlc_am_timer_poll_retransmit(int rlc_am_is_timer_poll_retransmit_time * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_poll_retransmit(void rlc_am_stop_and_reset_timer_poll_retransmit( +void rlc_am_stop_and_reset_timer_poll_retransmit( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP);) + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_start_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Re-arm (based on RLC AM config parameter) and start timer Poll-retransmit. @@ -87,9 +72,9 @@ protected_rlc_am_timer_poll_retransmit(void rlc_am_stop_and_reset_timer_poll_ret * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] frame Frame index */ -protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit( +void rlc_am_start_timer_poll_retransmit( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP);) + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_init_timer_poll_retransmit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP) * \brief Initialize the timer Poll-retransmit with RLC AM time-out config parameter. @@ -97,9 +82,9 @@ protected_rlc_am_timer_poll_retransmit(void rlc_am_start_timer_poll_retransmit( * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] time_outP Time-out in frame units. */ -protected_rlc_am_timer_poll_retransmit(void rlc_am_init_timer_poll_retransmit( +void rlc_am_init_timer_poll_retransmit( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, - const uint32_t time_outP);) + const uint32_t time_outP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.h index a2876d91694b91a66202a66c87f4c3a2943a700b..bca3e8376398c9e1605deae5f1363c4d4300f7b4 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.h @@ -34,48 +34,33 @@ */ #ifndef __RLC_AM_TIMER_REORDERING_H__ # define __RLC_AM_TIMER_REORDERING_H__ -# ifdef RLC_AM_TIMER_POLL_REORDERING_C -# define private_rlc_am_timer_reordering(x) x -# define protected_rlc_am_timer_reordering(x) x -# define public_rlc_am_timer_reordering(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_timer_reordering(x) -# define protected_rlc_am_timer_reordering(x) extern x -# define public_rlc_am_timer_reordering(x) extern x -# else -# define private_rlc_am_timer_reordering(x) -# define protected_rlc_am_timer_reordering(x) -# define public_rlc_am_timer_reordering(x) extern x -# endif -# endif /*! \fn void rlc_am_check_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Check if timer reordering has timed-out, if so it is stopped and has the status "timed-out". * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_reordering(void rlc_am_check_timer_reordering( +void rlc_am_check_timer_reordering( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP)); + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Stop and reset the timer reordering. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_reordering(void rlc_am_stop_and_reset_timer_reordering( +void rlc_am_stop_and_reset_timer_reordering( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP);) + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Re-arm (based on RLC AM config parameter) and start timer reordering. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_reordering(void rlc_am_start_timer_reordering( +void rlc_am_start_timer_reordering( const protocol_ctxt_t* const ctxt_pP, - rlc_am_entity_t* const rlc_pP);) + rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_init_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP) * \brief Initialize the timer reordering with RLC AM time-out config parameter. @@ -83,9 +68,9 @@ protected_rlc_am_timer_reordering(void rlc_am_start_timer_reordering( * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] time_outP Time-out in frameP units. */ -protected_rlc_am_timer_reordering(void rlc_am_init_timer_reordering( +void rlc_am_init_timer_reordering( const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, - const uint32_t time_outP);) + const uint32_t time_outP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.h index 31ff985e414a0e1c41e3a63d2786ce9f5000fcf4..04807418593d0cce4ea833e478ccf104fc596460 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.h @@ -34,42 +34,28 @@ */ #ifndef __RLC_AM_TIMER_STATUS_PROHIBIT_H__ # define __RLC_AM_TIMER_STATUS_PROHIBIT_H__ -# ifdef RLC_AM_TIMER_STATUS_PROHIBIT_C -# define private_rlc_am_timer_status_prohibit(x) x -# define protected_rlc_am_timer_status_prohibit(x) x -# define public_rlc_am_timer_status_prohibit(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_timer_status_prohibit(x) -# define protected_rlc_am_timer_status_prohibit(x) extern x -# define public_rlc_am_timer_status_prohibit(x) extern x -# else -# define private_rlc_am_timer_status_prohibit(x) -# define protected_rlc_am_timer_status_prohibit(x) -# define public_rlc_am_timer_status_prohibit(x) extern x -# endif -# endif + /*! \fn void rlc_am_check_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Check if timer status-prohibit has timed-out, if so it is stopped and has the status "timed-out". * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_status_prohibit(void rlc_am_check_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP)); +void rlc_am_check_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_stop_and_reset_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Stop and reset the timer status-prohibit. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_status_prohibit(void rlc_am_stop_and_reset_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP);) +void rlc_am_stop_and_reset_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_start_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP) * \brief Re-arm (based on RLC AM config parameter) and start timer status-prohibit. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC AM protocol instance pointer. */ -protected_rlc_am_timer_status_prohibit(void rlc_am_start_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP);) +void rlc_am_start_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP); /*! \fn void rlc_am_init_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP) * \brief Initialize the timer status-prohibit with RLC AM time-out config parameter. @@ -77,6 +63,6 @@ protected_rlc_am_timer_status_prohibit(void rlc_am_start_timer_status_prohibit(c * \param[in] rlc_pP RLC AM protocol instance pointer. * \param[in] time_outP Time-out in frameP units. */ -protected_rlc_am_timer_status_prohibit(void rlc_am_init_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP);) +void rlc_am_init_timer_status_prohibit(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlc_pP, const uint32_t time_outP); /** @} */ #endif diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_windows.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_windows.h index aff78a15c6e21c4298f7c813372c8822597b3b7d..be49e94120a021913945785c5d495ba5bf18fdba 100644 --- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_windows.h +++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_windows.h @@ -35,21 +35,6 @@ # ifndef __RLC_AM_WINDOWS_H__ # define __RLC_AM_WINDOWS_H__ //----------------------------------------------------------------------------- -# ifdef RLC_AM_WINDOWS_C -# define private_rlc_am_windows(x) x -# define protected_rlc_am_windows(x) x -# define public_rlc_am_windows(x) x -# else -# ifdef RLC_AM_MODULE -# define private_rlc_am_windows(x) -# define protected_rlc_am_windows(x) extern x -# define public_rlc_am_windows(x) extern x -# else -# define private_rlc_am_windows(x) -# define protected_rlc_am_windows(x) -# define public_rlc_am_windows(x) extern x -# endif -# endif /*! \fn signed int rlc_am_in_tx_window(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t snP) * \brief Boolean function, check if sequence number is VT(A) <= snP < VT(MS). @@ -58,10 +43,10 @@ * \param[in] snP Sequence number. * \return 1 if snP in tx window, else 0. */ -protected_rlc_am_windows(signed int rlc_am_in_tx_window( +signed int rlc_am_in_tx_window( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, - const rlc_sn_t snP);) + const rlc_sn_t snP); /*! \fn signed int rlc_am_in_rx_window(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t snP) * \brief Boolean function, check if sequence number is VR(R) <= snP < VR(MR). @@ -70,10 +55,10 @@ protected_rlc_am_windows(signed int rlc_am_in_tx_window( * \param[in] snP Sequence number. * \return 1 if snP in rx window, else 0. */ -protected_rlc_am_windows(signed int rlc_am_in_rx_window( +signed int rlc_am_in_rx_window( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, - const rlc_sn_t snP);) + const rlc_sn_t snP); /*! \fn signed int rlc_am_sn_gte_vr_h (const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t snP) * \brief Boolean function, check if sequence number is greater than or equal VR(R). @@ -82,10 +67,10 @@ protected_rlc_am_windows(signed int rlc_am_in_rx_window( * \param[in] snP Sequence number. * \return 1 if sequence number is greater than or equal VR(R), else 0. */ -protected_rlc_am_windows(signed int rlc_am_sn_gte_vr_h ( +signed int rlc_am_sn_gte_vr_h ( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, - const rlc_sn_t snP);) + const rlc_sn_t snP); /*! \fn signed int rlc_am_sn_gte_vr_x (const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t snP) * \brief Boolean function, check if sequence number is greater than or equal VR(X). @@ -94,10 +79,10 @@ protected_rlc_am_windows(signed int rlc_am_sn_gte_vr_h ( * \param[in] snP Sequence number. * \return 1 if sequence number is greater than or equal VR(X), else 0. */ -protected_rlc_am_windows(signed int rlc_am_sn_gte_vr_x ( +signed int rlc_am_sn_gte_vr_x ( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, - const rlc_sn_t snP);) + const rlc_sn_t snP); /*! \fn signed int rlc_am_sn_gt_vr_ms (const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t snP) * \brief Boolean function, check if sequence number is greater than VR(MS). @@ -106,10 +91,10 @@ protected_rlc_am_windows(signed int rlc_am_sn_gte_vr_x ( * \param[in] snP Sequence number. * \return 1 if sequence number is greater than VR(MS), else 0. */ -protected_rlc_am_windows(signed int rlc_am_sn_gt_vr_ms( +signed int rlc_am_sn_gt_vr_ms( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, - const rlc_sn_t snP);) + const rlc_sn_t snP); /*! \fn signed int rlc_am_tx_sn1_gt_sn2 (const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t sn1P, const rlc_sn_t sn2P) * \brief Boolean function, in the context of the tx window, check if sn1P is greater than sn2P. @@ -119,11 +104,11 @@ protected_rlc_am_windows(signed int rlc_am_sn_gt_vr_ms( * \param[in] sn2P Sequence number. * \return 1 if sn1P is greater than sn2P, else 0. */ -protected_rlc_am_windows(signed int rlc_am_tx_sn1_gt_sn2( +signed int rlc_am_tx_sn1_gt_sn2( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, const rlc_sn_t sn1P, - const rlc_sn_t sn2P);) + const rlc_sn_t sn2P); /*! \fn signed int rlc_am_rx_sn1_gt_sn2(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP, const rlc_sn_t sn1P, const rlc_sn_t sn2P) * \brief Boolean function, in the context of the rx window, check if sn1P is greater than sn2P. @@ -133,10 +118,10 @@ protected_rlc_am_windows(signed int rlc_am_tx_sn1_gt_sn2( * \param[in] sn2P Sequence number. * \return 1 if sn1P is greater than sn2P, else 0. */ -protected_rlc_am_windows(signed int rlc_am_rx_sn1_gt_sn2( +signed int rlc_am_rx_sn1_gt_sn2( const protocol_ctxt_t* const ctxt_pP, const rlc_am_entity_t* const rlc_pP, const rlc_sn_t sn1P, - const rlc_sn_t sn2P);) + const rlc_sn_t sn2P); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.h b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.h index a0049e4c2a5d89ab3f315c23ba8247019105eb61..a5bd0b9ef59d4d077791498f75204750410e345c 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.h +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm.h @@ -34,21 +34,6 @@ */ # ifndef __RLC_TM_H__ # define __RLC_TM_H__ -# ifdef RLC_TM_C -# define private_rlc_tm(x) -# define protected_rlc_tm(x) -# define public_rlc_tm(x) -# else -# ifdef RLC_TM_MODULE -# define private_rlc_tm(x) -# define protected_rlc_tm(x) extern x -# define public_rlc_tm(x) extern x -# else -# define private_rlc_tm(x) -# define protected_rlc_tm(x) -# define public_rlc_tm(x) extern x -# endif -# endif # include "platform_types.h" # include "rlc_def.h" # include "rlc_def_lte.h" @@ -75,21 +60,21 @@ * \param[in] srcP SDU data pointer. * \param[in] length_in_bitsP Length of SDU in bits. */ -private_rlc_tm(void rlc_tm_send_sdu ( +void rlc_tm_send_sdu ( const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlc_pP, const boolean_t error_indicationP, uint8_t * const srcP, - const sdu_size_t length_in_bitsP);) + const sdu_size_t length_in_bitsP); /*! \fn void rlc_tm_no_segment (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP) * \brief Schedule a SDU to be transmited by lower layers. * \param[in] ctxtP Running context. * \param[in] rlcP RLC TM protocol instance pointer. */ -private_rlc_tm(void rlc_tm_no_segment ( +void rlc_tm_no_segment ( const protocol_ctxt_t* const ctxt_pP, - rlc_tm_entity_t *const rlcP);) + rlc_tm_entity_t *const rlcP); /*! \fn void rlc_tm_rx (const protocol_ctxt_t* const ctxt_pP,void *const rlcP, struct mac_data_ind data_indP) * \brief Process the received PDUs from lower layer. @@ -97,10 +82,10 @@ private_rlc_tm(void rlc_tm_no_segment ( * \param[in] rlcP RLC TM protocol instance pointer. * \param[in] data_indP PDUs from MAC. */ -private_rlc_tm( void rlc_tm_rx ( +void rlc_tm_rx ( const protocol_ctxt_t* const ctxt_pP, void *const rlcP, - struct mac_data_ind data_indP);) + struct mac_data_ind data_indP); /*! \fn struct mac_status_resp rlc_tm_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void * const rlcP, const uint16_t tbs_sizeP, struct mac_status_ind tx_statusP) @@ -111,11 +96,12 @@ private_rlc_tm( void rlc_tm_rx ( * \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU. * \return The maximum number of bytes that can be served by RLC instance to MAC. */ -public_rlc_tm( struct mac_status_resp rlc_tm_mac_status_indication ( - const protocol_ctxt_t* const ctxt_pP, - void * const rlcP, - const uint16_t tb_sizeP, - struct mac_status_ind tx_statusP);) +struct mac_status_resp +rlc_tm_mac_status_indication ( + const protocol_ctxt_t* const ctxt_pP, + void * const rlc_pP, + const tb_size_t tb_sizeP, + struct mac_status_ind tx_statusP); /*! \fn struct mac_data_req rlc_tm_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void * const rlcP) @@ -124,9 +110,9 @@ public_rlc_tm( struct mac_status_resp rlc_tm_mac_status_indication ( * \param[in] rlcP RLC TM protocol instance pointer. * \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission. */ -public_rlc_tm( struct mac_data_req rlc_tm_mac_data_request ( +struct mac_data_req rlc_tm_mac_data_request ( const protocol_ctxt_t* const ctxt_pP, - void * const rlcP);) + void * const rlcP); /*! \fn void rlc_tm_mac_data_indication (const protocol_ctxt_t* const ctxt_pP,void * const rlcP, struct mac_data_ind data_indP) @@ -135,10 +121,10 @@ public_rlc_tm( struct mac_data_req rlc_tm_mac_data_request ( * \param[in] rlcP RLC TM protocol instance pointer. * \param[in] data_indP PDUs from MAC. */ -public_rlc_tm( void rlc_tm_mac_data_indication ( +void rlc_tm_mac_data_indication ( const protocol_ctxt_t* const ctxt_pP, void * const rlcP, - struct mac_data_ind data_indP);) + struct mac_data_ind data_indP); /*! \fn void rlc_tm_data_req (const protocol_ctxt_t* const ctxt_pP,void * const rlcP, mem_block_t * const sduP) @@ -147,10 +133,10 @@ public_rlc_tm( void rlc_tm_mac_data_indication ( * \param[in] rlcP RLC TM protocol instance pointer. * \param[in] sduP SDU. (A struct rlc_tm_data_req is mapped on sduP->data.) */ -public_rlc_tm( void rlc_tm_data_req ( +void rlc_tm_data_req ( const protocol_ctxt_t* const ctxt_pP, void * const rlcP, - mem_block_t * const sduP);) + mem_block_t * const sduP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h index 35e6c792aea248aaabb73ffad819af5de6a47c65..c6ab681819dbd10df750d388df57f19ca3443aae 100644 --- a/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h +++ b/openair2/LAYER2/RLC/TM_v9.3.0/rlc_tm_init.h @@ -42,21 +42,6 @@ //# include "rlc.h" # include "platform_types.h" //----------------------------------------------------------------------------- -# ifdef RLC_TM_INIT_C -# define private_rlc_tm_init(x) x -# define protected_rlc_tm_init(x) x -# define public_rlc_tm_init(x) x -# else -# ifdef RLC_TM_MODULE -# define private_rlc_tm_init(x) -# define protected_rlc_tm_init(x) extern x -# define public_rlc_tm_init(x) extern x -# else -# define private_rlc_tm_init(x) -# define protected_rlc_tm_init(x) -# define public_rlc_tm_init(x) extern x -# endif -# endif typedef volatile struct rlc_tm_info_s { uint8_t is_uplink_downlink; @@ -75,35 +60,35 @@ typedef volatile struct rlc_tm_info_s { * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_tm_init( void config_req_rlc_tm ( +void config_req_rlc_tm ( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, const rlc_tm_info_t * const config_tmP, const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) + const logical_chan_id_t chan_idP); /*! \fn void rlc_tm_init (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP) * \brief Initialize a RLC TM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC TM protocol instance will be in RLC_NULL_STATE state. * \param[in] rlcP RLC TM protocol instance pointer. */ -protected_rlc_tm_init(void rlc_tm_init ( +void rlc_tm_init ( const protocol_ctxt_t* const ctxt_pP, - rlc_tm_entity_t * const rlcP);) + rlc_tm_entity_t * const rlcP); /*! \fn void rlc_tm_reset_state_variables (const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP) * \brief Reset protocol variables and state variables to initial values. * \param[in] rlcP RLC TM protocol instance pointer. */ -protected_rlc_tm_init(void rlc_tm_reset_state_variables ( +void rlc_tm_reset_state_variables ( const protocol_ctxt_t* const ctxt_pP, - rlc_tm_entity_t * const rlcP);) + rlc_tm_entity_t * const rlcP); /*! \fn void rlc_tm_cleanup(rlc_tm_entity_t * const rlcP) * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC TM instance. * \param[in] rlcP RLC TM protocol instance pointer. */ -public_rlc_tm_init( void rlc_tm_cleanup( - rlc_tm_entity_t * const rlcP);) +void rlc_tm_cleanup( + rlc_tm_entity_t * const rlcP); /*! \fn void rlc_tm_configure(const protocol_ctxt_t* const ctxt_pP,rlc_tm_entity_t * const rlcP, const boolean_t is_uplink_downlinkP) * \brief Configure RLC TM protocol parameters. @@ -111,10 +96,10 @@ public_rlc_tm_init( void rlc_tm_cleanup( * \param[in] is_uplink_downlinkP Is this instance is TRANSMITTER_ONLY, RECEIVER_ONLY, or TRANSMITTER_AND_RECEIVER. */ -protected_rlc_tm_init(void rlc_tm_configure( +void rlc_tm_configure( const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP, - const boolean_t is_uplink_downlinkP);) + const boolean_t is_uplink_downlinkP); /*! \fn void rlc_tm_set_debug_infos(const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP, const rb_id_t rb_idP, const srb_flag_t srb_flagP) * \brief Set debug informations for a RLC TM protocol instance, these informations are only for trace purpose. @@ -123,12 +108,12 @@ protected_rlc_tm_init(void rlc_tm_configure( * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier */ -protected_rlc_tm_init(void rlc_tm_set_debug_infos( +void rlc_tm_set_debug_infos( const protocol_ctxt_t* const ctxt_pP, rlc_tm_entity_t * const rlcP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) + const logical_chan_id_t chan_idP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h index abf4f8ad6e991a59fd7e98c086b7d557f51f969f..f2f91ff68e66ec6db1155950eda21d91afc5f430 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h @@ -34,21 +34,6 @@ */ # ifndef __RLC_UM_H__ # define __RLC_UM_H__ -# ifdef RLC_UM_C -# define private_rlc_um(x) -# define protected_rlc_um(x) -# define public_rlc_um(x) -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um(x) -# define protected_rlc_um(x) extern x -# define public_rlc_um(x) extern x -# else -# define private_rlc_um(x) -# define protected_rlc_um(x) -# define public_rlc_um(x) extern x -# endif -# endif # include <errno.h> # include "platform_types.h" # include "rlc_def.h" @@ -141,40 +126,40 @@ * \param[out] stat_rx_data_bytes_out_of_window Number of data bytes received out of the receive window. * \param[out] stat_timer_reordering_timed_out Number of times the timer "reordering" has timed-out. */ -public_rlc_um(void rlc_um_stat_req (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, - unsigned int* stat_tx_pdcp_sdu, - unsigned int* stat_tx_pdcp_bytes, - unsigned int* stat_tx_pdcp_sdu_discarded, - unsigned int* stat_tx_pdcp_bytes_discarded, - unsigned int* stat_tx_data_pdu, - unsigned int* stat_tx_data_bytes, - unsigned int* stat_rx_pdcp_sdu, - unsigned int* stat_rx_pdcp_bytes, - unsigned int* stat_rx_data_pdus_duplicate, - unsigned int* stat_rx_data_bytes_duplicate, - unsigned int* stat_rx_data_pdu, - unsigned int* stat_rx_data_bytes, - unsigned int* stat_rx_data_pdu_dropped, - unsigned int* stat_rx_data_bytes_dropped, - unsigned int* stat_rx_data_pdu_out_of_window, - unsigned int* stat_rx_data_bytes_out_of_window, - unsigned int* stat_timer_reordering_timed_out);) +void rlc_um_stat_req (rlc_um_entity_t *rlc_pP, + unsigned int* stat_tx_pdcp_sdu, + unsigned int* stat_tx_pdcp_bytes, + unsigned int* stat_tx_pdcp_sdu_discarded, + unsigned int* stat_tx_pdcp_bytes_discarded, + unsigned int* stat_tx_data_pdu, + unsigned int* stat_tx_data_bytes, + unsigned int* stat_rx_pdcp_sdu, + unsigned int* stat_rx_pdcp_bytes, + unsigned int* stat_rx_data_pdus_duplicate, + unsigned int* stat_rx_data_bytes_duplicate, + unsigned int* stat_rx_data_pdu, + unsigned int* stat_rx_data_bytes, + unsigned int* stat_rx_data_pdu_dropped, + unsigned int* stat_rx_data_bytes_dropped, + unsigned int* stat_rx_data_pdu_out_of_window, + unsigned int* stat_rx_data_bytes_out_of_window, + unsigned int* stat_timer_reordering_timed_out); /*! \fn void rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Request the segmentation of SDUs based on status previously sent by MAC. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -private_rlc_um( void rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP);) - +void +rlc_um_get_pdus (const protocol_ctxt_t* const ctxt_pP, void *argP); /*! \fn void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indication) * \brief Process the received PDUs from lower layer. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] data_indication PDUs from MAC. */ -protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indication);) - +void +rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, void *argP, struct mac_data_ind data_indP); /*! \fn struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP) * \brief Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission. * \param[in] ctxt_pP Running context. @@ -183,14 +168,19 @@ protected_rlc_um( void rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_ * \param[in] tx_statusP Transmission status given by MAC on previous MAC transmission of the PDU. * \return The maximum number of bytes that can be served by RLC instance to MAC. */ -public_rlc_um( struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP, const eNB_flag_t enb_flagP);) +struct mac_status_resp +rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP); /*! \fn void rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * const rlc_pP, const tb_size_t tb_sizeP) * \brief Set available TBS size for MAC Tx. * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] tb_sizeP remaining TBS in bytes. */ -public_rlc_um( void rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * const rlc_pP, const tb_size_t tb_sizeP);) +void +rlc_um_set_nb_bytes_requested_by_mac ( + void * rlc_pP, + const tb_size_t tb_sizeP +); /*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,const eNB_flag_t enb_flagP) * \brief Gives PDUs to lower layer MAC. @@ -199,8 +189,8 @@ public_rlc_um( void rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * \param[in] enb_flagP eNB or UE flag. * \return A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission. */ -public_rlc_um( struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,const eNB_flag_t enb_flagP);) - +struct mac_data_req +rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,const eNB_flag_t enb_flagP); /*! \fn void rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,struct mac_data_ind data_indP) * \brief Receive PDUs from lower layer MAC. @@ -208,13 +198,12 @@ public_rlc_um( struct mac_data_req rlc_um_mac_data_request (const protocol_ct * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] data_indP PDUs from MAC. */ -public_rlc_um( void rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP);) /*! \fn uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP) * \brief Gets Tx Buffer Occupancy. * \param[in] rlc_pP RLC UM protocol instance pointer.) */ -public_rlc_um( uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP);) +uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP); /*! \fn void rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t *sduP) * \brief Interface with higher layers, buffer higher layer SDUS for transmission. @@ -222,6 +211,9 @@ public_rlc_um( uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP) * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] sduP SDU. (A struct rlc_um_data_req is mapped on sduP->data.) */ -public_rlc_um( void rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t *sduP);) +void +rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, struct mac_data_ind data_indP); +void +rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t *sdu_pP) ; /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.h index a73d6f86729c9dc2a622572af12666426e2ba8a6..524b75fe16dc99ff5995b9d4a3690198d3eb32d7 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_control_primitives.h @@ -43,21 +43,6 @@ # include "DL-UM-RLC.h" # include "UL-UM-RLC.h" //----------------------------------------------------------------------------- -# ifdef RLC_UM_CONTROL_PRIMITIVES_C -# define private_rlc_um_control_primitives(x) x -# define protected_rlc_um_control_primitives(x) x -# define public_rlc_um_control_primitives(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_control_primitives(x) -# define protected_rlc_um_control_primitives(x) extern x -# define public_rlc_um_control_primitives(x) extern x -# else -# define private_rlc_um_control_primitives(x) -# define protected_rlc_um_control_primitives(x) -# define public_rlc_um_control_primitives(x) extern x -# endif -# endif typedef volatile struct { uint32_t is_uplink_downlink; @@ -79,12 +64,12 @@ typedef volatile struct { * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_um_control_primitives( void config_req_rlc_um ( +void config_req_rlc_um ( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, const rlc_um_info_t * const config_umP, const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) + const logical_chan_id_t chan_idP); /*! \fn void config_req_rlc_um_asn1 ( * const protocol_ctxt_t* const ctxt_pP, @@ -106,7 +91,7 @@ public_rlc_um_control_primitives( void config_req_rlc_um ( * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -public_rlc_um_control_primitives( void config_req_rlc_um_asn1 ( +void config_req_rlc_um_asn1 ( const protocol_ctxt_t* const ctxt_pP, const srb_flag_t srb_flagP, const MBMS_flag_t mbms_flagP, @@ -120,32 +105,32 @@ public_rlc_um_control_primitives( void config_req_rlc_um_asn1 ( ,const uint32_t sourceL2Id ,const uint32_t destinationL2Id #endif - );) + ); /*! \fn void rlc_um_init (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Initialize a RLC UM protocol instance, initialize all variables, lists, allocate buffers for making this instance ready to be configured with protocol configuration parameters. After this initialization the RLC UM protocol instance will be in RLC_NULL_STATE state. * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -protected_rlc_um_control_primitives(void rlc_um_init ( +void rlc_um_init ( const protocol_ctxt_t* const ctxt_pP, - rlc_um_entity_t * const rlc_pP);) + rlc_um_entity_t * const rlc_pP); /*! \fn void rlc_um_reset_state_variables (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Reset protocol variables and state variables to initial values. * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -protected_rlc_um_control_primitives(void rlc_um_reset_state_variables ( +void rlc_um_reset_state_variables ( const protocol_ctxt_t* const ctxt_pP, - rlc_um_entity_t * const rlc_pP);) + rlc_um_entity_t * const rlc_pP); /*! \fn void rlc_um_cleanup(rlc_um_entity_t * const rlc_pP) * \brief Free all allocated memory (lists and buffers) previously allocated by this RLC UM instance. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -public_rlc_um_control_primitives( void rlc_um_cleanup( - rlc_um_entity_t * const rlc_pP);) +void rlc_um_cleanup( + rlc_um_entity_t * const rlc_pP); /*! \fn void rlc_um_configure( * const protocol_ctxt_t* const ctxt_pP, @@ -162,13 +147,13 @@ public_rlc_um_control_primitives( void rlc_um_cleanup( * \param[in] tx_sn_field_lengthP Length of the sequence number, 5 or 10 bits in transmission. * \param[in] is_mXchP Is the radio bearer for MCCH, MTCH. */ -protected_rlc_um_control_primitives(void rlc_um_configure( +void rlc_um_configure( const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP, const uint32_t timer_reorderingP, const uint32_t rx_sn_field_lengthP, const uint32_t tx_sn_field_lengthP, - const uint32_t is_mXchP);) + const uint32_t is_mXchP); /*! \fn void rlc_um_set_debug_infos( * const protocol_ctxt_t* const ctxt_pP, @@ -182,11 +167,11 @@ protected_rlc_um_control_primitives(void rlc_um_configure( * \param[in] rb_idP Radio bearer identifier. * \param[in] chan_idP Transport channel identifier. */ -protected_rlc_um_control_primitives(void rlc_um_set_debug_infos( +void rlc_um_set_debug_infos( const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, - const logical_chan_id_t chan_idP);) + const logical_chan_id_t chan_idP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.h index f62cddfbcae2c2437f8d7b4735635f39f23fc744..e0dccf2eeec8dc93af5cada0d6214df746d7117e 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.h @@ -40,21 +40,6 @@ # include "rlc_um_constants.h" # include "list.h" //----------------------------------------------------------------------------- -# ifdef RLC_UM_DAR_C -# define private_rlc_um_dar(x) x -# define protected_rlc_um_dar(x) x -# define public_rlc_um_dar(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_dar(x) -# define protected_rlc_um_dar(x) extern x -# define public_rlc_um_dar(x) extern x -# else -# define private_rlc_um_dar(x) -# define protected_rlc_um_dar(x) -# define public_rlc_um_dar(x) extern x -# endif -# endif /*! \fn signed int rlc_um_get_pdu_infos(const protocol_ctxt_t* const ctxt_pP,const rlc_um_entity_t * const rlc_pP,rlc_um_pdu_sn_10_t* header_pP, int16_t total_sizeP, rlc_um_pdu_info_t* pdu_info_pP, uint8_t sn_lengthP) * \brief Extract PDU informations (header fields, data size, etc) from the serialized PDU. * \param[in] ctxt_pP Running context. @@ -65,13 +50,13 @@ * \param[in] sn_lengthP Sequence number length in bits in PDU header (5 or 10). * \return 0 if no error was encountered during the parsing of the PDU, else -1; */ -protected_rlc_um_dar( signed int rlc_um_get_pdu_infos( +signed int rlc_um_get_pdu_infos( const protocol_ctxt_t* const ctxt_pP, const rlc_um_entity_t * const rlc_pP, rlc_um_pdu_sn_10_t * const header_pP, const sdu_size_t total_sizeP, rlc_um_pdu_info_t * const pdu_info_pP, - const uint8_t sn_lengthP)); + const uint8_t sn_lengthP); /*! \fn int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP) * \brief Reset protocol variables and state variables to initial values. @@ -82,7 +67,7 @@ protected_rlc_um_dar( signed int rlc_um_get_pdu_infos( * \param[in,out] data_size_pP Pointer on data size. * \return 0 if no error was encountered during the parsing of the PDU, else -1; */ -private_rlc_um_dar( int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP)); +int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_li_pP, unsigned int* li_array_pP, unsigned int *num_li_pP, sdu_size_t *data_size_pP); /*! \fn void rlc_um_try_reassembly (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, rlc_sn_t start_snP, rlc_sn_t end_snP) * \brief Try reassembly PDUs from DAR buffer, starting at sequence number snP. @@ -92,7 +77,7 @@ private_rlc_um_dar( int rlc_um_read_length_indicators(unsigned char**data_ppP, * \param[in] start_snP First PDU to be reassemblied if possible. * \param[in] end_snP Last excluded highest sequence number of PDU to be reassemblied. */ -private_rlc_um_dar( void rlc_um_try_reassembly (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t start_snP, const rlc_sn_t end_snP)); +void rlc_um_try_reassembly (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t start_snP, const rlc_sn_t end_snP); /*! \fn void rlc_um_check_timer_reordering(rlc_um_entity_t * const rlc_pP,frame_t frameP) * \brief Check if timer reordering has timed-out, if so it is stopped and has the status "timed-out". @@ -100,7 +85,7 @@ private_rlc_um_dar( void rlc_um_try_reassembly (const protocol_ctxt_t* con * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] frameP Frame index */ -protected_rlc_um_dar(void rlc_um_check_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP)); +void rlc_um_check_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP); /*! \fn void rlc_um_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Stop and reset the timer reordering. @@ -108,7 +93,7 @@ protected_rlc_um_dar(void rlc_um_check_timer_reordering(const protocol_ctxt_t* c * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] frameP Frame index. */ -protected_rlc_um_dar(void rlc_um_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP);) +void rlc_um_stop_and_reset_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *const rlc_pP); /*! \fn void rlc_um_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP) * \brief Re-arm (based on RLC UM config parameter) and start timer reordering. @@ -116,7 +101,7 @@ protected_rlc_um_dar(void rlc_um_stop_and_reset_timer_reordering(const protocol_ * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] frameP Frame index. */ -protected_rlc_um_dar(void rlc_um_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP);) +void rlc_um_start_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP); /*! \fn void rlc_um_init_timer_reordering(rlc_um_entity_t * const rlc_pP, const uint32_t ms_durationP) * \brief Initialize the timer reordering with RLC UM time-out config parameter. @@ -124,14 +109,14 @@ protected_rlc_um_dar(void rlc_um_start_timer_reordering(const protocol_ctxt_t* c * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] ms_durationP Duration in milliseconds units. */ -protected_rlc_um_dar(void rlc_um_init_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint32_t ms_durationP);) +void rlc_um_init_timer_reordering(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint32_t ms_durationP); /*! \fn void rlc_um_check_timer_dar_time_out(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,) * \brief Check if t-Reordering expires and take the appropriate actions as described in 3GPP specifications. * \param[in] ctxt_pP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -protected_rlc_um_dar( void rlc_um_check_timer_dar_time_out(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)); +void rlc_um_check_timer_dar_time_out(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP); /*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(rlc_um_entity_t * const rlc_pP, uint16_t snP) * \brief Remove the PDU with sequence number snP from the DAR buffer and return it. @@ -140,7 +125,7 @@ protected_rlc_um_dar( void rlc_um_check_timer_dar_time_out(const protocol_ctxt_ * \param[in] snP Sequence number. * \return The PDU stored in the DAR buffer having sequence number snP, else return NULL. */ -private_rlc_um_dar( mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP)); +mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP); /*! \fn mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP) * \brief Get the PDU with sequence number snP from the DAR buffer. @@ -149,7 +134,7 @@ private_rlc_um_dar( mem_block_t *rlc_um_remove_pdu_from_dar_buffer(const protoc * \param[in] snP Sequence number. * \return The PDU stored in the DAR buffer having sequence number snP, else return NULL. */ -protected_rlc_um_dar(mem_block_t* rlc_um_get_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP)); +mem_block_t* rlc_um_get_pdu_from_dar_buffer(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const uint16_t snP); /*! \fn signed int rlc_um_in_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,rlc_sn_t lower_boundP, rlc_sn_t snP, rlc_sn_t higher_boundP) * \brief Compute if the sequence number of a PDU is in a window . @@ -160,7 +145,7 @@ protected_rlc_um_dar(mem_block_t* rlc_um_get_pdu_from_dar_buffer(const protocol_ * \param[in] higher_boundP Higher bound of a window. * \return -2 if lower_boundP > sn, -1 if higher_boundP < sn, 0 if lower_boundP < sn < higher_boundP, 1 if lower_boundP == sn, 2 if higher_boundP == sn, 3 if higher_boundP == sn == lower_boundP. */ -protected_rlc_um_dar(signed int rlc_um_in_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t lower_boundP, const rlc_sn_t snP, const rlc_sn_t higher_boundP)); +signed int rlc_um_in_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t lower_boundP, const rlc_sn_t snP, const rlc_sn_t higher_boundP); /*! \fn signed int rlc_um_in_reordering_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t snP) * \brief Compute if the sequence number of a PDU is in a window . @@ -169,7 +154,7 @@ protected_rlc_um_dar(signed int rlc_um_in_window(const protocol_ctxt_t* const ct * \param[in] snP Sequence number of a theorical PDU. * \return 0 if snP is in reordering window, else -1. */ -protected_rlc_um_dar(signed int rlc_um_in_reordering_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t snP)); +signed int rlc_um_in_reordering_window(const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, const rlc_sn_t snP); /*! \fn void rlc_um_receive_process_dar (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t *pdu_mem_pP,rlc_um_pdu_sn_10_t * const pdu_pP, const sdu_size_t tb_sizeP) * \brief Apply the DAR process for a PDU: put it in DAR buffer and try to reassembly or discard it. @@ -179,7 +164,7 @@ protected_rlc_um_dar(signed int rlc_um_in_reordering_window(const protocol_ctxt_ * \param[in] pdu_pP Pointer on the header of the UM PDU. * \param[in] tb_sizeP Size of the UM PDU. */ -protected_rlc_um_dar(void rlc_um_receive_process_dar (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t * pdu_mem_pP,rlc_um_pdu_sn_10_t * const pdu_pP, - const sdu_size_t tb_sizeP)); +void rlc_um_receive_process_dar (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t * pdu_mem_pP,rlc_um_pdu_sn_10_t * const pdu_pP, + const sdu_size_t tb_sizeP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.h index 1f7310803be110ccc03916d5f3f92c19ce46772a..14ad253dcc9bc1b45780b4d6d660e15ba2ff2ae9 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_fsm.h @@ -35,21 +35,6 @@ # ifndef __RLC_UM_FSM_PROTO_EXTERN_H__ # define __RLC_UM_FSM_PROTO_EXTERN_H__ //----------------------------------------------------------------------------- -# ifdef RLC_UM_FSM_C -# define private_rlc_um_fsm(x) x -# define protected_rlc_um_fsm(x) x -# define public_rlc_um_fsm(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_fsm(x) -# define protected_rlc_um_fsm(x) extern x -# define public_rlc_um_fsm(x) extern x -# else -# define private_rlc_um_fsm(x) -# define protected_rlc_um_fsm(x) -# define public_rlc_um_fsm(x) extern x -# endif -# endif # include "platform_types.h" # include "rlc_um_entity.h" //----------------------------------------------------------------------------- @@ -65,6 +50,6 @@ * \return 1 if no error was encountered, 0 if the event was not processed. * \Note This FSM is not LTE 9.3.0 compliant, it has to be modified or removed. */ -protected_rlc_um_fsm(int rlc_um_fsm_notify_event (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP, uint8_t eventP)); +int rlc_um_fsm_notify_event (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP, uint8_t eventP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.h index 95aac89623e6adf29a531f60b871ee6f840e50e8..defdd1364e3d309cfdbc5fec69d93277ee671b1e 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_reassembly.h @@ -35,21 +35,6 @@ # ifndef __RLC_UM_REASSEMBLY_PROTO_EXTERN_H__ # define __RLC_UM_REASSEMBLY_PROTO_EXTERN_H__ //----------------------------------------------------------------------------- -# ifdef RLC_UM_REASSEMBLY_C -# define private_rlc_um_reassembly(x) x -# define protected_rlc_um_reassembly(x) x -# define public_rlc_um_reassembly(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_reassembly(x) -# define protected_rlc_um_reassembly(x) extern x -# define public_rlc_um_reassembly(x) extern x -# else -# define private_rlc_um_reassembly(x) -# define protected_rlc_um_reassembly(x) -# define public_rlc_um_reassembly(x) extern x -# endif -# endif # include "rlc_um_entity.h" //----------------------------------------------------------------------------- /*! \fn void rlc_um_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP) @@ -57,7 +42,7 @@ * \param[in] ctxtP Running context. * \param[in] rlcP RLC UM protocol instance pointer. */ -protected_rlc_um_reassembly(void rlc_um_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP)); +void rlc_um_clear_rx_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP); /*! \fn void rlc_um_reassembly (uint8_t * srcP, int32_t lengthP, rlc_um_entity_t *rlcP, frame_t frame) * \brief Reassembly lengthP bytes to the end of the SDU in construction. @@ -66,13 +51,13 @@ protected_rlc_um_reassembly(void rlc_um_clear_rx_sdu (const protocol_ctxt_t* con * \param[in] srcP Pointer on data to be reassemblied. * \param[in] lengthP Length to reassembly. */ -protected_rlc_um_reassembly(void rlc_um_reassembly (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP, uint8_t * srcP, int32_t lengthP)); +void rlc_um_reassembly (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP, uint8_t * srcP, int32_t lengthP); /*! \fn void rlc_um_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP) * \brief Send SDU if any reassemblied to upper layer. * \param[in] ctxtP Running context. * \param[in] rlcP RLC UM protocol instance pointer. */ -protected_rlc_um_reassembly(void rlc_um_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP)); +void rlc_um_send_sdu (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.h index 5e93f272fdb0140ae1506f32c33c038d8a78350d..84df8ac77c599ab836f9a19f6d4cd7d1064f5f1e 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.h @@ -33,22 +33,6 @@ */ # ifndef __RLC_UM_RECEIVER_PROTO_EXTERN_H__ # define __RLC_UM_RECEIVER_PROTO_EXTERN_H__ -# ifdef RLC_UM_RECEIVER_C -# define private_rlc_um_receiver(x) x -# define protected_rlc_um_receiver(x) x -# define public_rlc_um_receiver(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_receiver(x) -# define protected_rlc_um_receiver(x) extern x -# define public_rlc_um_receiver(x) extern x -# else -# define private_rlc_um_receiver(x) -# define protected_rlc_um_receiver(x) -# define public_rlc_um_receiver(x) extern x -# endif -# endif - # include "rlc_um_entity.h" # include "mac_primitives.h" @@ -57,7 +41,7 @@ * \param[in] ctxtP Running context. * \param[in] rlc_pP RLC UM protocol instance pointer. */ -protected_rlc_um_receiver( void rlc_um_display_rx_window(const protocol_ctxt_t* const ctxtP, rlc_um_entity_t * const rlc_pP);) +void rlc_um_display_rx_window(const protocol_ctxt_t* const ctxtP, rlc_um_entity_t * const rlc_pP); /*! \fn void rlc_um_receive (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP) * \brief Handle the MAC data indication, retreive the transport blocks and send them one by one to the DAR process. @@ -65,6 +49,6 @@ protected_rlc_um_receiver( void rlc_um_display_rx_window(const protocol_ctxt_t* * \param[in] rlc_pP RLC UM protocol instance pointer. * \param[in] data_indP Data indication structure containing transport block received from MAC layer. */ -protected_rlc_um_receiver( void rlc_um_receive (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP)); +void rlc_um_receive (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.h index 9794f9a502fa3628da00afbcfa83fd7f1fcbb06c..0d52f1a89689c06c74a55e4111cb80a1b06a1739 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.h @@ -40,27 +40,12 @@ # include "rlc_um_constants.h" # include "list.h" //----------------------------------------------------------------------------- -# ifdef RLC_UM_SEGMENT_C -# define private_rlc_um_segment(x) x -# define protected_rlc_um_segment(x) x -# define public_rlc_um_segment(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_segment(x) -# define protected_rlc_um_segment(x) extern x -# define public_rlc_um_segment(x) extern x -# else -# define private_rlc_um_segment(x) -# define protected_rlc_um_segment(x) -# define public_rlc_um_segment(x) extern x -# endif -# endif /*! \fn void rlc_um_segment_10 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP) * \brief Segmentation procedure with 10 bits sequence number, segment the first SDU in buffer and create a PDU of the size (nb_bytes_to_transmit) requested by MAC if possible and put it in the list "pdus_to_mac_layer". * \param[in] ctxtP Running context. * \param[in] rlcP RLC UM protocol instance pointer. */ -protected_rlc_um_segment(void rlc_um_segment_10 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP)); +void rlc_um_segment_10 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP); /*! \fn void rlc_um_segment_5 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP) @@ -68,6 +53,6 @@ protected_rlc_um_segment(void rlc_um_segment_10 (const protocol_ctxt_t* const ct * \param[in] ctxtP Running context. * \param[in] rlcP RLC UM protocol instance pointer. */ -protected_rlc_um_segment(void rlc_um_segment_5 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP)); +void rlc_um_segment_5 (const protocol_ctxt_t* const ctxtP, rlc_um_entity_t *rlcP); /** @} */ # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.h index 2c874b8d2432c32d4cdf7afe86a46e1da3b71478..6da464aa28ef0894808a884c628231a5020cfecf 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_test.h @@ -21,37 +21,22 @@ # ifndef __RLC_UM_TEST_H__ # define __RLC_UM_TEST_H__ -# ifdef RLC_UM_TEST_C -# define private_rlc_um_test(x) x -# define protected_rlc_um_test(x) x -# define public_rlc_um_test(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_test(x) -# define protected_rlc_um_test(x) extern x -# define public_rlc_um_test(x) extern x -# else -# define private_rlc_um_test(x) -# define protected_rlc_um_test(x) -# define public_rlc_um_test(x) extern x -# endif -# endif -public_rlc_um_test(rlc_um_entity_t um_tx;) -public_rlc_um_test(rlc_um_entity_t um_rx;) +rlc_um_entity_t um_tx; +rlc_um_entity_t um_rx; -protected_rlc_um_test(void rlc_um_v9_3_0_test_windows_5(void);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_windows_10(void);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_data_conf(module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_send_sdu(rlc_um_entity_t *um_txP, int sdu_indexP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_exchange_pdus(rlc_um_entity_t *um_txP,rlc_um_entity_t *um_RxP, uint16_t bytes_txP,uint16_t bytes_rxP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_exchange_delayed_pdus(rlc_um_entity_t *um_txP, rlc_um_entity_t *um_rxP, uint16_t bytes_txP, uint16_t bytes_rxP, signed int time_tx_delayedP, - signed int time_rx_delayedP, int is_frame_incrementedP);) -protected_rlc_um_test(void rlc_um_v9_3_0_buffer_delayed_rx_mac_data_ind(struct mac_data_ind* data_ind_rxP, signed int time_tx_delayedP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_data_req *data_requestP, int* drop_countP, int *tx_packetsP, int* dropped_tx_packetsP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_data_ind (module_id_t module_idP, rb_id_t rb_idP, sdu_size_t sizeP, - mem_block_t *sduP);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_tx_rx_10(void);) -protected_rlc_um_test(void rlc_um_v9_3_0_test_tx_rx_5(void);) -public_rlc_um_test( void rlc_um_v9_3_0_test_print_trace (void);) -public_rlc_um_test( void rlc_um_v9_3_0_test(void)); +void rlc_um_v9_3_0_test_windows_5(void); +void rlc_um_v9_3_0_test_windows_10(void); +void rlc_um_v9_3_0_test_data_conf(module_id_t module_idP, rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP); +void rlc_um_v9_3_0_test_send_sdu(rlc_um_entity_t *um_txP, int sdu_indexP); +void rlc_um_v9_3_0_test_exchange_pdus(rlc_um_entity_t *um_txP,rlc_um_entity_t *um_RxP, uint16_t bytes_txP,uint16_t bytes_rxP); +void rlc_um_v9_3_0_test_exchange_delayed_pdus(rlc_um_entity_t *um_txP, rlc_um_entity_t *um_rxP, uint16_t bytes_txP, uint16_t bytes_rxP, signed int time_tx_delayedP, + signed int time_rx_delayedP, int is_frame_incrementedP); +void rlc_um_v9_3_0_buffer_delayed_rx_mac_data_ind(struct mac_data_ind* data_ind_rxP, signed int time_tx_delayedP); +void rlc_um_v9_3_0_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_data_req *data_requestP, int* drop_countP, int *tx_packetsP, int* dropped_tx_packetsP); +void rlc_um_v9_3_0_test_data_ind (module_id_t module_idP, rb_id_t rb_idP, sdu_size_t sizeP, + mem_block_t *sduP); +void rlc_um_v9_3_0_test_tx_rx_10(void); +void rlc_um_v9_3_0_test_tx_rx_5(void); +void rlc_um_v9_3_0_test_print_trace (void); +void rlc_um_v9_3_0_test(void); # endif diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h index 261183ad1d8be8660725d96b39f22da32d91e649..598518f1c864b92e877dd2a4d1b81b531e2aae8d 100644 --- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h +++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_very_simple_test.h @@ -37,21 +37,6 @@ # include "rlc_um_structs.h" # include "rlc_um_constants.h" //----------------------------------------------------------------------------- -# ifdef RLC_UM_VERY_SIMPLE_TEST_C -# define private_rlc_um_very_simple_test(x) x -# define protected_rlc_um_very_simple_test(x) x -# define public_rlc_um_very_simple_test(x) x -# else -# ifdef RLC_UM_MODULE -# define private_rlc_um_very_simple_test(x) -# define protected_rlc_um_very_simple_test(x) extern x -# define public_rlc_um_very_simple_test(x) extern x -# else -# define private_rlc_um_very_simple_test(x) -# define protected_rlc_um_very_simple_test(x) -# define public_rlc_um_very_simple_test(x) extern x -# endif -# endif #define RLC_UM_TEST_SDU_TYPE_TCPIP 0 #define RLC_UM_TEST_SDU_TYPE_VOIP 1 #define RLC_UM_TEST_SDU_TYPE_SMALL 2 @@ -61,5 +46,5 @@ #define voip_sdu "Nos tests montrent que le nouveau Toshiba MK7559GSXP, un disque dur de 750 Go" #define very_small_sdu "NoS tEsTs MoNtReNt" -public_rlc_um_very_simple_test(void rlc_um_test_send_sdu (rlc_um_entity_t* rlcP, uint32_t frame, unsigned int sdu_typeP)); +void rlc_um_test_send_sdu (rlc_um_entity_t* rlcP, uint32_t frame, unsigned int sdu_typeP); # endif diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c index 67bf20d0148d1936bf6f0574baf5814fe6bac926..045fcbc6018102ec3e510b63cf4931d094541f0b 100644 --- a/openair2/LAYER2/RLC/rlc.c +++ b/openair2/LAYER2/RLC/rlc.c @@ -30,6 +30,7 @@ #include "rlc.h" #include "mem_block.h" #include "../MAC/mac_extern.h" +#include "LAYER2/RLC/UM_v9.3.0/rlc_um.h" #include "UTIL/LOG/log.h" #include "UTIL/OCG/OCG_vars.h" #include "UTIL/LOG/vcd_signal_dumper.h" @@ -226,8 +227,7 @@ rlc_op_status_t rlc_stat_req ( *stat_rx_data_bytes_out_of_window = 0; *stat_timer_poll_retransmit_timed_out = 0; *stat_timer_status_prohibit_timed_out = 0; - rlc_um_stat_req (ctxt_pP, - &rlc_union_p->rlc.um, + rlc_um_stat_req (&rlc_union_p->rlc.um, stat_tx_pdcp_sdu, stat_tx_pdcp_bytes, stat_tx_pdcp_sdu_discarded, diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h index 8f4773a36e246ffb56af4f662ba3682c4ef7cf98..112215a093a3814897e91280d73303d517199ec5 100644 --- a/openair2/LAYER2/RLC/rlc.h +++ b/openair2/LAYER2/RLC/rlc.h @@ -59,49 +59,8 @@ #include "PMCH-InfoList-r9.h" #endif -#ifdef CMAKER typedef uint64_t hash_key_t; #define HASHTABLE_NOT_A_KEY_VALUE ((uint64_t)-1) -#endif -//----------------------------------------------------------------------------- -# ifdef RLC_MAC_C -# define private_rlc_mac(x) x -# define public_rlc_mac(x) x -# else -# define private_rlc_mac(x) -# define public_rlc_mac(x) extern x -# endif - -# ifdef RLC_MPLS_C -# define private_rlc_mpls(x) x -# define public_rlc_mpls(x) x -# else -# define private_rlc_mpls(x) -# define public_rlc_mpls(x) extern x -# endif - -# ifdef RLC_RRC_C -# define private_rlc_rrc(x) x -# define public_rlc_rrc(x) x -# else -# define private_rlc_rrc(x) -# define public_rlc_rrc(x) extern x -# endif - -# ifdef RLC_C -# define private_rlc(x) x -# define protected_rlc(x) x -# define public_rlc(x) x -# else -# define private_rlc(x) -# if defined(RLC_MAC_C) || defined(RLC_MPLS_C) || defined(RLC_RRC_C) || defined(RLC_AM_C) || defined(RLC_TM_C) || defined(RLC_UM_C) || defined (PDCP_C) -# define protected_rlc(x) extern x -# else -# define protected_rlc(x) -# endif -# define public_rlc(x) extern x -# endif - //----------------------------------------------------------------------------- #define RLC_OP_STATUS_OK 1 @@ -176,17 +135,17 @@ typedef struct { #define RLC_MAX_MBMS_LC (maxSessionPerPMCH * maxServiceCount) #define RLC_MAX_LC ((max_val_DRB_Identity+1)* MAX_MOBILES_PER_ENB) -protected_rlc(void (*rlc_rrc_data_ind)( +void (*rlc_rrc_data_ind)( const protocol_ctxt_t* const ctxtP, const rb_id_t rb_idP, const sdu_size_t sdu_sizeP, - const uint8_t * const sduP);) + const uint8_t * const sduP); -protected_rlc(void (*rlc_rrc_data_conf)( +void (*rlc_rrc_data_conf)( const protocol_ctxt_t* const ctxtP, const rb_id_t rb_idP, const mui_t muiP, - const rlc_tx_status_t statusP);) + const rlc_tx_status_t statusP); typedef void (rrc_data_ind_cb_t)( const protocol_ctxt_t* const ctxtP, @@ -234,10 +193,10 @@ typedef struct rlc_mbms_id_s { # define maxSessionPerPMCH 1 # endif #endif -//public_rlc(rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -//public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h -public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +//rlc_mbms_t rlc_mbms_array_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +//rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[MAX_MOBILES_PER_ENB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h +rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RLC_MAX_MBMS_LC]; // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h #define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD] ; @@ -253,8 +212,8 @@ public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[MAX_eNB][RL rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD] = lOG_cH_iD; \ } while (0); -public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ -public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ +logical_chan_id_t rlc_mbms_rbid2lcid_ue [MAX_MOBILES_PER_ENB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ +logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX]; /*!< \brief Pairing logical channel identifier with radio bearer identifer. */ #define RLC_COLL_KEY_VALUE(eNB_iD, rNTI, iS_eNB, rB_iD, iS_sRB) \ @@ -302,7 +261,7 @@ public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[MAX_eNB][NB_RB_MBMS_MAX]; (((hash_key_t)(sESSION_ID)) << 37) | \ (((hash_key_t)(0x0000000000000001)) << 63)) -public_rlc(hash_table_t *rlc_coll_p;) +hash_table_t *rlc_coll_p; /*! \fn tbs_size_t mac_rlc_serialize_tb (char* bufferP, list_t transport_blocksP) * \brief Serialize a list of transport blocks coming from RLC in order to be processed by MAC. @@ -310,7 +269,7 @@ public_rlc(hash_table_t *rlc_coll_p;) * \param[in] transport_blocksP List of transport blocks. * \return The amount of bytes that have been written due to serialization. */ -private_rlc_mac(tbs_size_t mac_rlc_serialize_tb (char*, list_t);) +tbs_size_t mac_rlc_serialize_tb (char*, list_t); /*! \fn struct mac_data_ind mac_rlc_deserialize_tb (char* bufferP, tb_size_t tb_sizeP, num_tb_t num_tbP, crc_t *crcsP) * \brief Serialize a list of transport blocks coming from RLC in order to be processed by MAC. @@ -320,7 +279,7 @@ private_rlc_mac(tbs_size_t mac_rlc_serialize_tb (char*, list_t);) * \param[in] crcsP Array of CRC for each transport block. * \return A mac_data_ind structure containing a list of transport blocks. */ -private_rlc_mac(struct mac_data_ind mac_rlc_deserialize_tb (char*, tb_size_t, num_tb_t, crc_t *);) +struct mac_data_ind mac_rlc_deserialize_tb (char*, tb_size_t, num_tb_t, crc_t *); //----------------------------------------------------------------------------- @@ -336,14 +295,14 @@ private_rlc_mac(struct mac_data_ind mac_rlc_deserialize_tb (char*, tb_size_t, * \param[in] pmch_info_listP eMBMS pmch info list to be created. * \return A status about the processing, OK or error code. */ -public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req ( +rlc_op_status_t rrc_rlc_config_asn1_req ( const protocol_ctxt_t* const, const SRB_ToAddModList_t* const , const DRB_ToAddModList_t* const , const DRB_ToReleaseList_t* const , const PMCH_InfoList_r9_t * const pmch_info_listP , const uint32_t , - const uint32_t );) + const uint32_t ); #else /*! \fn rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t* const ctxtP, const SRB_ToAddModList_t* const srb2add_listP, const DRB_ToAddModList_t* const drb2add_listP, const DRB_ToReleaseList_t* const drb2release_listP) * \brief Function for RRC to configure a Radio Bearer. @@ -353,11 +312,11 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req ( * \param[in] drb2release_listP DRB configuration list to be released. * \return A status about the processing, OK or error code. */ -public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req ( +rlc_op_status_t rrc_rlc_config_asn1_req ( const protocol_ctxt_t* const, const SRB_ToAddModList_t* const , const DRB_ToAddModList_t* const , - const DRB_ToReleaseList_t* const );) + const DRB_ToReleaseList_t* const ); #endif @@ -366,8 +325,8 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_asn1_req ( * struct pointed by of the rlcu_pP parameter. Free the rlc_union_t struct also. * \param[in] rlcu_pP Pointer on the rlc_union_t struct. */ -public_rlc_rrc(void - rb_free_rlc_union (void *rlcu_pP);) +void + rb_free_rlc_union (void *rlcu_pP); /*! \fn rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const ctxtP) @@ -375,7 +334,7 @@ public_rlc_rrc(void * \param[in] ctxtP Running context. * \return A status about the processing, OK or error code. */ -public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const);) +rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const); /*! \fn rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP) @@ -386,7 +345,7 @@ public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const); * \param[in] rb_idP Radio bearer identifier. * \return A status about the processing, OK or error code. */ -public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t, const rb_id_t );) +rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t, const rb_id_t ); /*! \fn rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, logical_chan_id_t chan_idP, rlc_mode_t rlc_modeP) * \brief Add a RLC protocol instance to a radio bearer. @@ -398,12 +357,12 @@ public_rlc_rrc(rlc_op_status_t rrc_rlc_remove_rlc (const protocol_ctxt_t* cons * \param[in] rlc_modeP Mode of RLC (AM, UM, TM). * \return A status about the processing, OK or error code. */ -private_rlc_rrc(rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t MBMS_flagP, const rb_id_t, logical_chan_id_t, rlc_mode_t +rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t MBMS_flagP, const rb_id_t, logical_chan_id_t, rlc_mode_t #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,const uint32_t sourceL2Id, const uint32_t destinationL2Id #endif -);) +); /*! \fn rlc_op_status_t rrc_rlc_config_req ( const protocol_ctxt_t* const ctxtP, @@ -421,13 +380,13 @@ private_rlc_rrc(rlc_union_t* rrc_rlc_add_rlc (const protocol_ctxt_t* const * \param[in] rlc_infoP RLC configuration parameters issued from Radio Resource Manager. * \return A status about the processing, OK or error code. */ -public_rlc_rrc( rlc_op_status_t rrc_rlc_config_req ( +rlc_op_status_t rrc_rlc_config_req ( const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t, config_action_t, const rb_id_t, - rlc_info_t );) + rlc_info_t ); /*! \fn rlc_op_status_t rrc_rlc_data_req (const protocol_ctxt_t* const ctxtP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, mui_t muiP, confirm_t confirmP, sdu_size_t sdu_sizeP, char* sduP) * \brief Function for RRC to send a SDU through a Signalling Radio Bearer. @@ -440,14 +399,14 @@ public_rlc_rrc( rlc_op_status_t rrc_rlc_config_req ( * \param[in] sduP SDU. * \return A status about the processing, OK or error code. */ -public_rlc_rrc( rlc_op_status_t rrc_rlc_data_req (const protocol_ctxt_t* const , const MBMS_flag_t, const rb_id_t, mui_t, confirm_t, sdu_size_t, char *);) +rlc_op_status_t rrc_rlc_data_req (const protocol_ctxt_t* const , const MBMS_flag_t, const rb_id_t, mui_t, confirm_t, sdu_size_t, char *); /*! \fn void rrc_rlc_register_rrc ( void (*rrc_data_indP) (const protocol_ctxt_t* const ctxtP, const rb_id_t rb_idP, sdu_size_t sdu_sizeP, char* sduP), void (*rrc_data_confP) (const protocol_ctxt_t* const ctxtP, const rb_id_t rb_idP, mui_t muiP, rlc_tx_status_t statusP) * \brief This function is called by RRC to register its DATA-INDICATE and DATA-CONFIRM handlers to RLC layer. * \param[in] rrc_data_indP Pointer on RRC data indicate function. * \param[in] rrc_data_confP Pointer on RRC data confirm callback function. */ -public_rlc_rrc(void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP);) +void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t rrc_data_confP); //----------------------------------------------------------------------------- // PUBLIC INTERFACE WITH MAC @@ -464,12 +423,12 @@ public_rlc_rrc(void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_d * \param [in,out] bufferP Memory area to fill with the bytes requested by MAC. * \return A status about the processing, OK or error code. */ -public_rlc_mac(tbs_size_t mac_rlc_data_req (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, const tb_size_t,char* +tbs_size_t mac_rlc_data_req (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, const tb_size_t,char* #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,const uint32_t sourceL2Id ,const uint32_t destinationL2Id #endif -);) +); /*! \fn void mac_rlc_data_ind (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const eNB_flag_t eNB_flagP, const MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, uint32_t frameP, char* bufferP, tb_size_t tb_sizeP, num_tb_t num_tbP, crc_t *crcs) * \brief Interface with MAC layer, deserialize the transport blocks sent by MAC, then map data indication to the RLC instance corresponding to the radio bearer identifier. @@ -484,8 +443,8 @@ public_rlc_mac(tbs_size_t mac_rlc_data_req (const module_id_t, co * \param[in] num_tbP Number of transport blocks. * \param[in] crcs Array of CRC decoding. */ -public_rlc_mac(void mac_rlc_data_ind (const module_id_t, const rnti_t, const eNB_index_t,const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, - crc_t* );) +void mac_rlc_data_ind (const module_id_t, const rnti_t, const eNB_index_t,const frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, + crc_t* ); /*! \fn mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const sub_frame_t subframeP, const eNB_flag_t eNB_flagP, const MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, tb_size_t tb_sizeP) * \brief Interface with MAC layer, request and set the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier. @@ -499,12 +458,12 @@ public_rlc_mac(void mac_rlc_data_ind (const module_id_t, co * \param[in] tb_sizeP Size of a transport block set in bytes. * \return The maximum number of bytes that the RLC instance can send in the next transmission sequence. */ -public_rlc_mac(mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, tb_size_t +mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const MBMS_flag_t, logical_chan_id_t, tb_size_t #if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) ,const uint32_t sourceL2Id ,const uint32_t destinationL2Id #endif - );) + ); /*! \fn rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t module_idP, const rnti_t rntiP, const eNB_index_t eNB_index, const frame_t frameP, const sub_frame_t subframeP,const eNB_flag_t enb_flagP, const logical_chan_id_t channel_idP) * \brief Interface with MAC layer, UE only: request and get the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier. @@ -516,7 +475,7 @@ public_rlc_mac(mac_rlc_status_resp_t mac_rlc_status_ind (const module_id_t, co * \param[in] channel_idP Logical Channel identifier. * \return The maximum number of bytes that the RLC instance can send in the next transmission sequence. */ -public_rlc_mac(rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const logical_chan_id_t );) +rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const logical_chan_id_t ); //----------------------------------------------------------------------------- // RLC methods //----------------------------------------------------------------------------- @@ -527,10 +486,10 @@ public_rlc_mac(rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const mod * @param dataP Pointer to data buffer to be displayed * @param sizeP Number of octets in data buffer */ -public_rlc(void rlc_util_print_hex_octets( +void rlc_util_print_hex_octets( const comp_name_t componentP, unsigned char* const dataP, - const signed long sizeP);) + const signed long sizeP); @@ -546,7 +505,7 @@ public_rlc(void rlc_util_print_hex_octets( * \param[in] sduP SDU. * \return A status about the processing, OK or error code. */ -public_rlc(rlc_op_status_t rlc_data_req ( +rlc_op_status_t rlc_data_req ( const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t , @@ -559,7 +518,7 @@ public_rlc(rlc_op_status_t rlc_data_req ( ,const uint32_t * const ,const uint32_t * const #endif - );) + ); /*! \fn void rlc_data_ind (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const MBMS_flag_t MBMS_flagP, const rb_id_t rb_idP, const sdu_size_t sdu_sizeP, mem_block_t* sduP) { * \brief Interface with higher layers, route SDUs coming from RLC protocol instances to upper layer instance. @@ -570,13 +529,13 @@ public_rlc(rlc_op_status_t rlc_data_req ( * \param[in] sdu_sizeP Size of SDU in bytes. * \param[in] sduP SDU. */ -public_rlc(void rlc_data_ind( +void rlc_data_ind( const protocol_ctxt_t* const, const srb_flag_t, const MBMS_flag_t , const rb_id_t, const sdu_size_t, - mem_block_t* const);) + mem_block_t* const); /*! \fn void rlc_data_conf (const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, const mui_t muiP, const rlc_tx_status_t statusP) @@ -587,12 +546,12 @@ public_rlc(void rlc_data_ind( * \param[in] muiP Message Unit identifier. * \param[in] statusP Status of the transmission (RLC_SDU_CONFIRM_YES, RLC_SDU_CONFIRM_NO). */ -public_rlc(void rlc_data_conf( +void rlc_data_conf( const protocol_ctxt_t* const, const srb_flag_t, const rb_id_t, const mui_t, - const rlc_tx_status_t );) + const rlc_tx_status_t ); /*! \fn rlc_op_status_t rlc_stat_req ( @@ -662,7 +621,7 @@ public_rlc(void rlc_data_conf( * \param[out] stat_timer_status_prohibit_timed_out Number of times the timer "status_prohibit" has timed-out. */ -public_rlc(rlc_op_status_t rlc_stat_req ( +rlc_op_status_t rlc_stat_req ( const protocol_ctxt_t* const ctxtP, const srb_flag_t srb_flagP, const rb_id_t rb_idP, @@ -693,12 +652,12 @@ public_rlc(rlc_op_status_t rlc_stat_req ( unsigned int* const stat_rx_control_bytes, unsigned int* const stat_timer_reordering_timed_out, unsigned int* const stat_timer_poll_retransmit_timed_out, - unsigned int* const stat_timer_status_prohibit_timed_out);) + unsigned int* const stat_timer_status_prohibit_timed_out); /*! \fn int rlc_module_init(void) * \brief RAZ the memory of the RLC layer, initialize the memory pool manager (mem_block_t structures mainly used in RLC module). */ -public_rlc(int rlc_module_init(void);) +int rlc_module_init(void); /** @} */ diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c index d922a1dae29fd9cae3ec44e751df3b9adbb1061c..ef94dd6f9738f816973d47a131086fb2b05ef024 100644 --- a/openair2/LAYER2/RLC/rlc_mac.c +++ b/openair2/LAYER2/RLC/rlc_mac.c @@ -30,6 +30,7 @@ //----------------------------------------------------------------------------- #define RLC_MAC_C #include "rlc.h" +#include "LAYER2/RLC/UM_v9.3.0/rlc_um.h" #include "LAYER2/MAC/mac_extern.h" #include "UTIL/LOG/log.h" #include "UTIL/OCG/OCG_vars.h" diff --git a/openair2/NETWORK_DRIVER/UE_IP/device.c b/openair2/NETWORK_DRIVER/UE_IP/device.c index 36c6afe914bb3f16f8ab5367733d879d7b65f4c3..b8b4428709dab0c5ee5067ff9e8861624df2446a 100644 --- a/openair2/NETWORK_DRIVER/UE_IP/device.c +++ b/openair2/NETWORK_DRIVER/UE_IP/device.c @@ -236,7 +236,7 @@ int ue_ip_hard_start_xmit(struct sk_buff *skb_pP, struct net_device *dev_pP) // End debug information netif_stop_queue(dev_pP); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE >= 1796 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796) netif_trans_update(dev_pP); #else dev_pP->trans_start = jiffies; @@ -312,7 +312,7 @@ void ue_ip_tx_timeout(struct net_device *dev_pP) printk("[UE_IP_DRV][%s] begin\n", __FUNCTION__); // (ue_ip_priv_t *)(dev_pP->priv_p)->stats.tx_errors++; (priv_p->stats).tx_errors++; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || RHEL_RELEASE_CODE >= 1796 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0) || (defined RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= 1796) netif_trans_update(dev_pP); #else dev_pP->trans_start = jiffies; diff --git a/openair2/RRC/LTE/rrc_UE_ral.h b/openair2/RRC/LTE/rrc_UE_ral.h index e2b4a3dadb5debaaaf005ec143bb04ee505bd37d..dfa971d28ca01e83476147c4fe2d547657381e09 100644 --- a/openair2/RRC/LTE/rrc_UE_ral.h +++ b/openair2/RRC/LTE/rrc_UE_ral.h @@ -30,21 +30,6 @@ #ifndef __RRC_UE_RAL_H__ # define __RRC_UE_RAL_H__ //----------------------------------------------------------------------------- -# ifdef RRC_UE_RAL_C -# define private_rrc_ue_ral(x) x -# define protected_rrc_ue_ral(x) x -# define public_rrc_ue_ral(x) x -# else -# ifdef RRC_UE -# define private_rrc_ue_ral(x) -# define protected_rrc_ue_ral(x) extern x -# define public_rrc_ue_ral(x) extern x -# else -# define private_rrc_ue_ral(x) -# define protected_rrc_ue_ral(x) -# define public_rrc_ue_ral(x) extern x -# endif -# endif //----------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> @@ -58,7 +43,7 @@ #include "ral_messages_types.h" #include "defs.h" -private_rrc_ue_ral( int rrc_ue_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP);) -private_rrc_ue_ral( int rrc_ue_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t *param_type_pP, ral_threshold_t *threshold_pP);) -protected_rrc_ue_ral(int rrc_ue_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP);) +int rrc_ue_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP); +int rrc_ue_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t *param_type_pP, ral_threshold_t *threshold_pP); +int rrc_ue_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP); #endif diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 539e316537823738ca5b57e1791abe2391e3a8e8..c9992ceea5933100cb200fb231123e6ccc057afb 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -7620,7 +7620,6 @@ rrc_eNB_process_SidelinkUEInformation( { SL_DestinationInfoList_r12_t *destinationInfoList; int n_destinations = 0; - int ue_type = 0; int n_discoveryMessages = 0; LOG_I(RRC, @@ -7668,7 +7667,6 @@ rrc_eNB_process_SidelinkUEInformation( if ((sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension != NULL) &&(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13 != NULL)) { if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.count > 0) { n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.count; - ue_type = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13; destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t)); for (int i=0; i< n_destinations; i++ ){ //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelayUC_r13->destinationInfoList_r12.list.array[i]); @@ -7684,7 +7682,6 @@ rrc_eNB_process_SidelinkUEInformation( if ((sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension != NULL) && (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13 != NULL)) { if (sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.count > 0){ n_destinations = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.count; - ue_type = sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->ue_Type_r13; destinationInfoList = CALLOC(1, sizeof(SL_DestinationInfoList_r12_t)); for (int i=0; i< n_destinations; i++ ){ //sl_DestinationIdentityList[i] = *(sidelinkUEInformation->criticalExtensions.choice.c1.choice.sidelinkUEInformation_r12.nonCriticalExtension->commTxResourceInfoReqRelay_r13->commTxResourceReqRelay_r13->destinationInfoList_r12.list.array[i]); diff --git a/openair2/RRC/LTE/rrc_eNB_ral.h b/openair2/RRC/LTE/rrc_eNB_ral.h index 143537e45cb1bb8b32af540f675dc93d55851694..bfdcdc1d533345bd9219819e82502ff87b78f3f1 100644 --- a/openair2/RRC/LTE/rrc_eNB_ral.h +++ b/openair2/RRC/LTE/rrc_eNB_ral.h @@ -30,21 +30,6 @@ #ifndef __RRC_ENB_RAL_H__ # define __RRC_ENB_RAL_H__ //----------------------------------------------------------------------------- -# ifdef RRC_ENB_RAL_C -# define private_rrc_enb_ral(x) x -# define protected_rrc_enb_ral(x) x -# define public_rrc_enb_ral(x) x -# else -# ifdef RRC_ENB -# define private_rrc_enb_ral(x) -# define protected_rrc_enb_ral(x) extern x -# define public_rrc_enb_ral(x) extern x -# else -# define private_rrc_enb_ral(x) -# define protected_rrc_enb_ral(x) -# define public_rrc_enb_ral(x) extern x -# endif -# endif //----------------------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> @@ -59,9 +44,9 @@ #include "defs.h" -private_rrc_enb_ral( int rrc_enb_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP);) -private_rrc_enb_ral( int rrc_enb_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t* param_type_pP, - ral_threshold_t* threshold_pP);) -protected_rrc_enb_ral(int rrc_enb_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP);) +int rrc_enb_ral_delete_all_thresholds_type (unsigned int mod_idP, ral_link_param_type_t *param_type_pP); +int rrc_enb_ral_delete_threshold (unsigned int mod_idP, ral_link_param_type_t* param_type_pP, + ral_threshold_t* threshold_pP); +int rrc_enb_ral_handle_configure_threshold_request(unsigned int mod_idP, MessageDef *msg_pP); #endif diff --git a/openair2/UTIL/CLI/cli_if.h b/openair2/UTIL/CLI/cli_if.h index 539ecd465ab7ecac6227a0dd611ac8a48863a6a7..858cb6bc762b380a7527ff2adf42f00447683262 100644 --- a/openair2/UTIL/CLI/cli_if.h +++ b/openair2/UTIL/CLI/cli_if.h @@ -38,30 +38,14 @@ extern "C" { #endif -# ifdef COMPONENT_CLI -# ifdef COMPONENT_CLI_IF -# define private_cli_if(x) x -# define friend_cli_if(x) x -# define public_cli_if(x) x -# else -# define private_cli_if(x) -# define friend_cli_if(x) extern x -# define public_cli_if(x) extern x -# endif -# else -# define private_cli_if(x) -# define friend_cli_if(x) -# define public_cli_if(x) extern x -# endif - /** @defgroup _cli_if Interfaces of CLI * @{*/ -public_cli_if( void cli_init (void); ) -public_cli_if( int cli_server_init(cli_handler_t handler); ) -public_cli_if(void cli_server_cleanup(void);) -public_cli_if(void cli_server_recv(const void * data, socklen_t len);) +void cli_init (void); +int cli_server_init(cli_handler_t handler); +void cli_server_cleanup(void); +void cli_server_recv(const void * data, socklen_t len); /* @}*/ #ifdef __cplusplus diff --git a/openair2/UTIL/FIFO/pad_list.h b/openair2/UTIL/FIFO/pad_list.h index ecafed7cc44afc06773781013c1a86952aa7ae05..2a9ef9893f09512f3b867773cfbc54978c0dad0d 100644 --- a/openair2/UTIL/FIFO/pad_list.h +++ b/openair2/UTIL/FIFO/pad_list.h @@ -32,21 +32,6 @@ #include "types.h" //----------------------------------------------------------------------------- -# ifdef list_C -# define private_list(x) x -# define public_list(x) x -# else -# define private_list(x) -# define public_list(x) extern x -# endif -# ifdef LIST2_C -# define private_list2(x) x -# define public_list2(x) x -# else -# define private_list2(x) -# define public_list2(x) extern x -# endif -//----------------------------------------------------------------------------- typedef struct Job_List_s { Job_elt_t *head; @@ -67,36 +52,36 @@ typedef struct Packet_OTG_List_s { } Packet_OTG_List_t; //----------------------------------------------------------------------------- -public_list( void job_list_init (Job_List_t*);) -public_list( void job_list_free (Job_List_t* listP);) -public_list( Job_elt_t* job_list_get_head (Job_List_t*);) -public_list( Job_elt_t* job_list_remove_head (Job_List_t* );) -public_list( Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*);) -public_list( void job_list_add_head (Job_elt_t* , Job_List_t* );) -public_list( void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* );) -public_list( void job_list_add_list (Job_List_t* , Job_List_t* );) -public_list( void job_list_display (Job_List_t* );) +void job_list_init (Job_List_t*); +void job_list_free (Job_List_t* listP); +Job_elt_t* job_list_get_head (Job_List_t*); +Job_elt_t* job_list_remove_head (Job_List_t* ); +Job_elt_t* job_list_remove_element (Job_elt_t*, Job_List_t*); +void job_list_add_head (Job_elt_t* , Job_List_t* ); +void job_list_add_tail_eurecom (Job_elt_t* , Job_List_t* ); +void job_list_add_list (Job_List_t* , Job_List_t* ); +void job_list_display (Job_List_t* ); -public_list( void event_list_init (Event_List_t*);) -public_list( void event_list_free (Event_List_t* listP);) -public_list( Event_elt_t* event_list_get_head (Event_List_t*);) -public_list( Event_elt_t* event_list_remove_head (Event_List_t* );) -public_list( Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*);) -public_list( void event_list_add_head (Event_elt_t* , Event_List_t* );) -public_list( void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* );) -public_list( void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* );) -public_list( void event_list_add_list (Event_List_t* , Event_List_t* );) -public_list( void event_list_display (Event_List_t* );) +void event_list_init (Event_List_t*); +void event_list_free (Event_List_t* listP); +Event_elt_t* event_list_get_head (Event_List_t*); +Event_elt_t* event_list_remove_head (Event_List_t* ); +Event_elt_t* event_list_remove_element (Event_elt_t*, Event_List_t*); +void event_list_add_head (Event_elt_t* , Event_List_t* ); +void event_list_add_element (Event_elt_t* , Event_elt_t* , Event_List_t* ); +void event_list_add_tail_eurecom (Event_elt_t* , Event_List_t* ); +void event_list_add_list (Event_List_t* , Event_List_t* ); +void event_list_display (Event_List_t* ); -public_list( void pkt_list_init (Packet_OTG_List_t*);) -public_list( void pkt_list_free (Packet_OTG_List_t* listP);) -public_list( Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*);) -public_list( Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* );) -public_list( Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*);) -public_list( void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* );) -public_list( void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* );) -public_list( void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* );) -public_list( void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* );) -public_list( void pkt_list_display (Packet_OTG_List_t* );) +void pkt_list_init (Packet_OTG_List_t*); +void pkt_list_free (Packet_OTG_List_t* listP); +Packet_otg_elt_t* pkt_list_get_head (Packet_OTG_List_t*); +Packet_otg_elt_t* pkt_list_remove_head (Packet_OTG_List_t* ); +Packet_otg_elt_t* pkt_list_remove_element (Packet_otg_elt_t*, Packet_OTG_List_t*); +void pkt_list_add_head (Packet_otg_elt_t* , Packet_OTG_List_t* ); +void pkt_list_add_element (Packet_otg_elt_t* , Packet_otg_elt_t* , Packet_OTG_List_t* ); +void pkt_list_add_tail_eurecom (Packet_otg_elt_t* , Packet_OTG_List_t* ); +void pkt_list_add_list (Packet_OTG_List_t* , Packet_OTG_List_t* ); +void pkt_list_display (Packet_OTG_List_t* ); #endif diff --git a/openair2/UTIL/LISTS/list.h b/openair2/UTIL/LISTS/list.h index 864804c5913e750dbcb744b5bb38b8352d3f4d0d..bf4d7e7580efed434dc3df51396004231445ad7a 100644 --- a/openair2/UTIL/LISTS/list.h +++ b/openair2/UTIL/LISTS/list.h @@ -39,66 +39,36 @@ #ifndef __LIST_H__ # define __LIST_H__ -# include "UTIL/MEM/mem_block.h" //----------------------------------------------------------------------------- -# ifdef LIST_C -# define private_list(x) x -# define public_list(x) x -# else -# define private_list(x) -# define public_list(x) extern x -# endif -# ifdef LIST2_C -# define private_list2(x) x -# define public_list2(x) x -# else -# define private_list2(x) -# define public_list2(x) extern x -# endif //----------------------------------------------------------------------------- -#include "platform_constants.h" #include<linux/types.h> #include<stdlib.h> #include<sys/queue.h> -#define LIST_NAME_MAX_CHAR 32 +#include "UTIL/MEM/mem_block.h" - -typedef struct { - struct mem_block_t *head; - struct mem_block_t *tail; - int nb_elements; - char name[LIST_NAME_MAX_CHAR]; -} list2_t; -//----------------------------------------------------------------------------- -typedef struct { - struct mem_block_t *head; - struct mem_block_t *tail; - int nb_elements; - char name[LIST_NAME_MAX_CHAR]; -} list_t; //----------------------------------------------------------------------------- -public_list( void list_init (list_t* , char *);) -public_list( void list_free (list_t* listP);) -public_list( mem_block_t* list_get_head (list_t*);) -public_list( mem_block_t* list_remove_head (list_t* );) -public_list( mem_block_t* list_remove_element (mem_block_t*, list_t*);) -public_list( void list_add_head (mem_block_t* , list_t* );) -public_list( void list_add_tail_eurecom (mem_block_t* , list_t* );) -public_list( void list_add_list (list_t* , list_t* );) -public_list( void list_display (list_t* );) +void list_init (list_t* , char *); +void list_free (list_t* listP); +mem_block_t* list_get_head (list_t*); +mem_block_t* list_remove_head (list_t* ); +mem_block_t* list_remove_element (mem_block_t*, list_t*); +void list_add_head (mem_block_t* , list_t* ); +void list_add_tail_eurecom (mem_block_t* , list_t* ); +void list_add_list (list_t* , list_t* ); +void list_display (list_t* ); //----------------------------------------------------------------------------- -public_list2( void list2_init (list2_t*, char*);) -public_list2( void list2_free (list2_t* );) -public_list2( mem_block_t* list2_get_head (list2_t*);) -public_list2( mem_block_t* list2_get_tail (list2_t*);) -public_list2( mem_block_t* list2_remove_element (mem_block_t* , list2_t* );) -public_list2( mem_block_t* list2_remove_head (list2_t* );) -public_list2( mem_block_t* list2_remove_tail (list2_t* );) -public_list2( void list2_add_head (mem_block_t* , list2_t* );) -public_list2( void list2_add_tail (mem_block_t* , list2_t* );) -public_list2( void list2_add_list (list2_t* , list2_t* );) -public_list2( void list2_display (list2_t* );) +void list2_init (list2_t*, char*); +void list2_free (list2_t* ); +mem_block_t* list2_get_head (list2_t*); +mem_block_t* list2_get_tail (list2_t*); +mem_block_t* list2_remove_element (mem_block_t* , list2_t* ); +mem_block_t* list2_remove_head (list2_t* ); +mem_block_t* list2_remove_tail (list2_t* ); +void list2_add_head (mem_block_t* , list2_t* ); +void list2_add_tail (mem_block_t* , list2_t* ); +void list2_add_list (list2_t* , list2_t* ); +void list2_display (list2_t* ); //----------------------------------------------------------------------------- /* The following lists are used for sorting numbers */ #ifndef LINUX_LIST @@ -126,11 +96,11 @@ struct list { }; #endif //----------------------------------------------------------------------------- -public_list2( void push_front (struct list*, double); ) -public_list2( void initialize (struct list*); ) -public_list2( void del (struct list*); ) -public_list2( void totable (double*, struct list*);) -public_list2( int compare (const void * a, const void * b);) -public_list2( int32_t calculate_median(struct list *loc_list);) +void push_front (struct list*, double); +void initialize (struct list*); +void del (struct list*); +void totable (double*, struct list*); +int compare (const void * a, const void * b); +int32_t calculate_median(struct list *loc_list); #endif diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 9660923157c35c28f43ddc767b319d7d8b1c753a..263f360db5a2d304c55e8e4382294098587e67d4 100644 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -275,19 +275,20 @@ void log_getconfig(log_t *g_log) { char *glogverbo = NULL; int level,verbosity; paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC; - paramdef_t logparams_level[MAX_LOG_COMPONENTS]; - paramdef_t logparams_verbosity[MAX_LOG_COMPONENTS]; - paramdef_t logparams_logfile[MAX_LOG_COMPONENTS]; + paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS]; + paramdef_t logparams_verbosity[MAX_LOG_PREDEF_COMPONENTS]; + paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS]; int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX); if (ret <0) { fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed"); return; } - memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); - memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); - memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_COMPONENTS); - for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { + + memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS); + memset(logparams_verbosity,0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS); + memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS); + for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) { if(g_log->log_component[i].name == NULL) { g_log->log_component[i].name = malloc(16); sprintf((char *)g_log->log_component[i].name,"comp%i?",i); @@ -308,25 +309,61 @@ void log_getconfig(log_t *g_log) { logparams_logfile[i].optname[j] = tolower(logparams_logfile[i].optname[j]); /* */ logparams_level[i].defstrval = gloglevel; - logparams_verbosity[i].defstrval = glogverbo; - + logparams_verbosity[i].defstrval = glogverbo; + logparams_logfile[i].defstrval = malloc(strlen(g_log->log_component[i].name) + 16); + sprintf(logparams_logfile[i].defstrval,"/tmp/oai%s.log",g_log->log_component[i].name); + logparams_logfile[i].numelt = 0; + logparams_verbosity[i].numelt = 0; + logparams_level[i].numelt = 0; logparams_level[i].type = TYPE_STRING; logparams_verbosity[i].type = TYPE_STRING; logparams_logfile[i].type = TYPE_UINT; logparams_logfile[i].paramflags = logparams_logfile[i].paramflags|PARAMFLAG_BOOL; } - config_get( logparams_level, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); - config_get( logparams_verbosity,MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); - config_get( logparams_logfile, MAX_LOG_COMPONENTS,CONFIG_STRING_LOG_PREFIX); - for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { + config_get( logparams_level, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + config_get( logparams_verbosity,MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX); + for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) { verbosity = map_str_to_int(log_verbosity_names,*(logparams_verbosity[i].strptr)); level = map_str_to_int(log_level_names, *(logparams_level[i].strptr)); set_comp_log(i, level,verbosity,1); set_component_filelog(*(logparams_logfile[i].uptr)); + if ( logparams_logfile[i].defstrval != NULL) { + free (logparams_logfile[i].defstrval); } + } } +int register_log_component(char *name, char *fext, int compidx) +{ +int computed_compidx=compidx; + + if (strlen(fext) > 3) { + fext[3]=0; /* limit log file extension to 3 chars */ + } + if (compidx < 0) { /* this is not a pre-defined component */ + for (int i = MAX_LOG_PREDEF_COMPONENTS; i< MAX_LOG_COMPONENTS; i++) { + if (g_log->log_component[i].name == NULL) { + computed_compidx=i; + break; + } + } + } + if (computed_compidx >= 0 && computed_compidx <MAX_LOG_COMPONENTS) { + g_log->log_component[computed_compidx].name = strdup(name); + g_log->log_component[computed_compidx].level = LOG_ALERT; + g_log->log_component[computed_compidx].flag = LOG_MED; + g_log->log_component[computed_compidx].interval = 1; + g_log->log_component[computed_compidx].fd = 0; + g_log->log_component[computed_compidx].filelog = 0; + g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s rounded to ^2 */ + sprintf(g_log->log_component[computed_compidx].filelog_name,"/tmp/%s.%s",name,fext); + } else { + fprintf(stderr,"{LOG} %s %d Couldn't register componemt %s\n",__FILE__,__LINE__,name); + } +return computed_compidx; +} int logInit (void) { @@ -340,287 +377,54 @@ int logInit (void) #if ! defined(CN_BUILD) - g_log->log_component[PHY].name = "PHY"; - g_log->log_component[PHY].level = LOG_EMERG; - g_log->log_component[PHY].flag = LOG_MED; - g_log->log_component[PHY].interval = 1; - g_log->log_component[PHY].fd = 0; - g_log->log_component[PHY].filelog = 0; - g_log->log_component[PHY].filelog_name = "/tmp/phy.log"; - - g_log->log_component[MAC].name = "MAC"; - g_log->log_component[MAC].level = LOG_EMERG; - g_log->log_component[MAC].flag = LOG_MED; - g_log->log_component[MAC].interval = 1; - g_log->log_component[MAC].fd = 0; - g_log->log_component[MAC].filelog = 0; - g_log->log_component[MAC].filelog_name = "/tmp/mac.log"; - - g_log->log_component[OPT].name = "OPT"; - g_log->log_component[OPT].level = LOG_EMERG; - g_log->log_component[OPT].flag = LOG_MED; - g_log->log_component[OPT].interval = 1; - g_log->log_component[OPT].fd = 0; - g_log->log_component[OPT].filelog = 0; - g_log->log_component[OPT].filelog_name = ""; - - g_log->log_component[RLC].name = "RLC"; - g_log->log_component[RLC].level = LOG_INFO; - g_log->log_component[RLC].flag = LOG_MED; - g_log->log_component[RLC].interval = 1; - g_log->log_component[RLC].fd = 0; - g_log->log_component[RLC].filelog = 0; - g_log->log_component[RLC].filelog_name = "/tmp/rlc.log"; - - g_log->log_component[PDCP].name = "PDCP"; - g_log->log_component[PDCP].level = LOG_INFO; - g_log->log_component[PDCP].flag = LOG_MED; - g_log->log_component[PDCP].interval = 1; - g_log->log_component[PDCP].fd = 0; - g_log->log_component[PDCP].filelog = 0; - g_log->log_component[PDCP].filelog_name = "/tmp/pdcp.log"; - - g_log->log_component[RRC].name = "RRC"; - g_log->log_component[RRC].level = LOG_TRACE; - g_log->log_component[RRC].flag = LOG_MED; - g_log->log_component[RRC].interval = 1; - g_log->log_component[RRC].fd = 0; - g_log->log_component[RRC].filelog = 0; - g_log->log_component[RRC].filelog_name = "/tmp/rrc.log"; - - g_log->log_component[EMU].name = "EMU"; - g_log->log_component[EMU].level = LOG_EMERG; - g_log->log_component[EMU].flag = LOG_MED; - g_log->log_component[EMU].interval = 1; - g_log->log_component[EMU].fd = 0; - g_log->log_component[EMU].filelog = 0; - g_log->log_component[EMU].filelog_name = ""; - - g_log->log_component[OMG].name = "OMG"; - g_log->log_component[OMG].level = LOG_EMERG; - g_log->log_component[OMG].flag = LOG_MED; - g_log->log_component[OMG].interval = 1; - g_log->log_component[OMG].fd = 0; - g_log->log_component[OMG].filelog = 0; - g_log->log_component[OMG].filelog_name = "/tmp/omg.csv"; - - g_log->log_component[OTG].name = "OTG"; - g_log->log_component[OTG].level = LOG_EMERG; - g_log->log_component[OTG].flag = LOG_MED; - g_log->log_component[OTG].interval = 1; - g_log->log_component[OTG].fd = 0; - g_log->log_component[OTG].filelog = 0; - g_log->log_component[OTG].filelog_name = "/tmp/otg.log"; - - g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY"; - g_log->log_component[OTG_LATENCY].level = LOG_EMERG; - g_log->log_component[OTG_LATENCY].flag = LOG_MED; - g_log->log_component[OTG_LATENCY].interval = 1; - g_log->log_component[OTG_LATENCY].fd = 0; - g_log->log_component[OTG_LATENCY].filelog = 0; - g_log->log_component[OTG_LATENCY].filelog_name = "/tmp/otg_latency.dat"; - - g_log->log_component[OTG_LATENCY_BG].name = "OTG_LATENCY_BG"; - g_log->log_component[OTG_LATENCY_BG].level = LOG_EMERG; - g_log->log_component[OTG_LATENCY_BG].flag = LOG_MED; - g_log->log_component[OTG_LATENCY_BG].interval = 1; - g_log->log_component[OTG_LATENCY_BG].fd = 0; - g_log->log_component[OTG_LATENCY_BG].filelog = 0; - g_log->log_component[OTG_LATENCY_BG].filelog_name = "/tmp/otg_latency_bg.dat"; - - g_log->log_component[OTG_GP].name = "OTG_GP"; - g_log->log_component[OTG_GP].level = LOG_EMERG; - g_log->log_component[OTG_GP].flag = LOG_MED; - g_log->log_component[OTG_GP].interval = 1; - g_log->log_component[OTG_GP].fd = 0; - g_log->log_component[OTG_GP].filelog = 0; - g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_goodput.dat"; - - g_log->log_component[OTG_GP_BG].name = "OTG_GP_BG"; - g_log->log_component[OTG_GP_BG].level = LOG_EMERG; - g_log->log_component[OTG_GP_BG].flag = LOG_MED; - g_log->log_component[OTG_GP_BG].interval = 1; - g_log->log_component[OTG_GP_BG].fd = 0; - g_log->log_component[OTG_GP_BG].filelog = 0; - g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_goodput_bg.dat"; - - g_log->log_component[OTG_JITTER].name = "OTG_JITTER"; - g_log->log_component[OTG_JITTER].level = LOG_EMERG; - g_log->log_component[OTG_JITTER].flag = LOG_MED; - g_log->log_component[OTG_JITTER].interval = 1; - g_log->log_component[OTG_JITTER].fd = 0; - g_log->log_component[OTG_JITTER].filelog = 0; - g_log->log_component[OTG_JITTER].filelog_name = "/tmp/otg_jitter.dat"; - - g_log->log_component[OCG].name = "OCG"; - g_log->log_component[OCG].level = LOG_EMERG; - g_log->log_component[OCG].flag = LOG_MED; - g_log->log_component[OCG].interval = 1; - g_log->log_component[OCG].fd = 0; - g_log->log_component[OCG].filelog = 0; - g_log->log_component[OCG].filelog_name = ""; - - g_log->log_component[PERF].name = "PERF"; - g_log->log_component[PERF].level = LOG_EMERG; - g_log->log_component[PERF].flag = LOG_MED; - g_log->log_component[PERF].interval = 1; - g_log->log_component[PERF].fd = 0; - g_log->log_component[PERF].filelog = 0; - g_log->log_component[PERF].filelog_name = ""; - - g_log->log_component[OIP].name = "OIP"; - g_log->log_component[OIP].level = LOG_EMERG; - g_log->log_component[OIP].flag = LOG_MED; - g_log->log_component[OIP].interval = 1; - g_log->log_component[OIP].fd = 0; - g_log->log_component[OIP].filelog = 0; - g_log->log_component[OIP].filelog_name = ""; - - g_log->log_component[CLI].name = "CLI"; - g_log->log_component[CLI].level = LOG_EMERG; - g_log->log_component[CLI].flag = LOG_MED; - g_log->log_component[CLI].interval = 1; - g_log->log_component[CLI].fd = 0; - g_log->log_component[CLI].filelog = 0; - g_log->log_component[CLI].filelog_name = ""; - - g_log->log_component[MSC].name = "MSC"; - g_log->log_component[MSC].level = LOG_EMERG; - g_log->log_component[MSC].flag = LOG_MED; - g_log->log_component[MSC].interval = 1; - g_log->log_component[MSC].fd = 0; - g_log->log_component[MSC].filelog = 0; - g_log->log_component[MSC].filelog_name = "/tmp/msc.log"; - - g_log->log_component[OCM].name = "OCM"; - g_log->log_component[OCM].level = LOG_EMERG; - g_log->log_component[OCM].flag = LOG_MED; - g_log->log_component[OCM].interval = 1; - g_log->log_component[OCM].fd = 0; - g_log->log_component[OCM].filelog = 0; - g_log->log_component[OCM].filelog_name = "/tmp/ocm.log"; - - g_log->log_component[HW].name = "HW"; - g_log->log_component[HW].level = LOG_EMERG; - g_log->log_component[HW].flag = LOG_MED; - g_log->log_component[HW].interval = 1; - g_log->log_component[HW].fd = 0; - g_log->log_component[HW].filelog = 0; - g_log->log_component[HW].filelog_name = ""; - - g_log->log_component[OSA].name = "OSA"; - g_log->log_component[OSA].level = LOG_EMERG; - g_log->log_component[OSA].flag = LOG_MED; - g_log->log_component[OSA].interval = 1; - g_log->log_component[OSA].fd = 0; - g_log->log_component[OSA].filelog = 0; - g_log->log_component[OSA].filelog_name = ""; - - g_log->log_component[RAL_ENB].name = "eRAL"; - g_log->log_component[RAL_ENB].level = LOG_EMERG; - g_log->log_component[RAL_ENB].flag = LOG_MED; - g_log->log_component[RAL_ENB].interval = 1; - g_log->log_component[RAL_ENB].fd = 0; - g_log->log_component[RAL_ENB].filelog = 0; - g_log->log_component[RAL_ENB].filelog_name = ""; - - g_log->log_component[RAL_UE].name = "mRAL"; - g_log->log_component[RAL_UE].level = LOG_EMERG; - g_log->log_component[RAL_UE].flag = LOG_MED; - g_log->log_component[RAL_UE].interval = 1; - g_log->log_component[RAL_UE].fd = 0; - g_log->log_component[RAL_UE].filelog = 0; - g_log->log_component[RAL_UE].filelog_name = ""; - - g_log->log_component[ENB_APP].name = "ENB_APP"; - g_log->log_component[ENB_APP].level = LOG_EMERG; - g_log->log_component[ENB_APP].flag = LOG_MED; - g_log->log_component[ENB_APP].interval = 1; - g_log->log_component[ENB_APP].fd = 0; - g_log->log_component[ENB_APP].filelog = 0; - g_log->log_component[ENB_APP].filelog_name = ""; - - g_log->log_component[FLEXRAN_AGENT].name = "FLEXRAN_AGENT"; - g_log->log_component[FLEXRAN_AGENT].level = LOG_DEBUG; - g_log->log_component[FLEXRAN_AGENT].flag = LOG_MED; - g_log->log_component[FLEXRAN_AGENT].interval = 1; - g_log->log_component[FLEXRAN_AGENT].fd = 0; - g_log->log_component[FLEXRAN_AGENT].filelog = 0; - g_log->log_component[FLEXRAN_AGENT].filelog_name = ""; - - g_log->log_component[TMR].name = "TMR"; - g_log->log_component[TMR].level = LOG_EMERG; - g_log->log_component[TMR].flag = LOG_MED; - g_log->log_component[TMR].interval = 1; - g_log->log_component[TMR].fd = 0; - g_log->log_component[TMR].filelog = 0; - g_log->log_component[TMR].filelog_name = ""; - - g_log->log_component[USIM].name = "USIM"; - g_log->log_component[USIM].level = LOG_DEBUG; - g_log->log_component[USIM].flag = LOG_NONE; - g_log->log_component[USIM].interval = 1; - g_log->log_component[USIM].fd = 0; - g_log->log_component[USIM].filelog = 0; - g_log->log_component[USIM].filelog_name = "/tmp/usim.txt"; - /* following log component are used for the localization*/ - g_log->log_component[LOCALIZE].name = "LOCALIZE"; - g_log->log_component[LOCALIZE].level = LOG_EMERG; - g_log->log_component[LOCALIZE].flag = LOG_MED; - g_log->log_component[LOCALIZE].interval = 1; - g_log->log_component[LOCALIZE].fd = 0; - g_log->log_component[LOCALIZE].filelog = 0; - g_log->log_component[LOCALIZE].filelog_name = "/tmp/localize.log"; -#endif // ! defined(CN_BUILD) + register_log_component("PHY","log",PHY); + register_log_component("MAC","log",MAC); + register_log_component("OPT","log",OPT); + register_log_component("RLC","log",RLC); + register_log_component("PDCP","log",PDCP); + register_log_component("RRC","log",RRC); + register_log_component("EMU","log",EMU); + register_log_component("OMG","csv",OMG); + register_log_component("OTG","log",OTG); + register_log_component("OTG_LATENCY","dat",OTG_LATENCY); + register_log_component("OTG_LATENCY_BG","dat",OTG_LATENCY_BG); + register_log_component("OTG_GP","dat",OTG_GP); + register_log_component("OTG_GP_BG","dat",OTG_GP_BG); + register_log_component("OTG_JITTER","dat",OTG_JITTER); + register_log_component("OCG","",OCG); + register_log_component("PERF","",PERF); + register_log_component("OIP","",OIP); + register_log_component("CLI","",CLI); + register_log_component("MSC","log",MSC); + register_log_component("OCM","log",OCM); + register_log_component("HW","",HW); + register_log_component("OSA","",OSA); + register_log_component("eRAL","",RAL_ENB); + register_log_component("mRAL","",RAL_UE); + register_log_component("ENB_APP","log",ENB_APP); + register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT); + register_log_component("TMR","",TMR); + register_log_component("USIM","txt",USIM); - g_log->log_component[NAS].name = "NAS"; - g_log->log_component[NAS].level = LOG_TRACE; - g_log->log_component[NAS].flag = LOG_MED; - g_log->log_component[NAS].interval = 1; - g_log->log_component[NAS].fd = 0; - g_log->log_component[NAS].filelog = 0; - g_log->log_component[NAS].filelog_name = "/tmp/nas.log"; - g_log->log_component[UDP_].name = "UDP"; - g_log->log_component[UDP_].level = LOG_EMERG; + /* following log component are used for the localization*/ + register_log_component("LOCALIZE","log",LOCALIZE); +#endif // ! defined(CN_BUILD) + register_log_component("NAS","log",NAS); + register_log_component("UDP","",UDP_); g_log->log_component[UDP_].flag = LOG_FULL; - g_log->log_component[UDP_].interval = 1; - g_log->log_component[UDP_].fd = 0; - g_log->log_component[UDP_].filelog = 0; - g_log->log_component[UDP_].filelog_name = ""; - g_log->log_component[GTPU].name = "GTPV1U"; - g_log->log_component[GTPU].level = LOG_EMERG; + register_log_component("GTPV1U","",GTPU); g_log->log_component[GTPU].flag = LOG_FULL; - g_log->log_component[GTPU].interval = 1; - g_log->log_component[GTPU].fd = 0; - g_log->log_component[GTPU].filelog = 0; - g_log->log_component[GTPU].filelog_name = ""; - g_log->log_component[S1AP].name = "S1AP"; - g_log->log_component[S1AP].level = LOG_EMERG; + register_log_component("S1AP","",S1AP); g_log->log_component[S1AP].flag = LOG_FULL; - g_log->log_component[S1AP].interval = 1; - g_log->log_component[S1AP].fd = 0; - g_log->log_component[S1AP].filelog = 0; - g_log->log_component[S1AP].filelog_name = ""; - - g_log->log_component[SCTP].name = "SCTP"; - g_log->log_component[SCTP].level = LOG_EMERG; - g_log->log_component[SCTP].flag = LOG_MED; - g_log->log_component[SCTP].interval = 1; - g_log->log_component[SCTP].fd = 0; - g_log->log_component[SCTP].filelog = 0; - g_log->log_component[SCTP].filelog_name = ""; + + register_log_component("SCTP","",SCTP); + register_log_component("RRH","",RRH); - g_log->log_component[RRH].name = "RRH"; - g_log->log_component[RRH].level = LOG_EMERG; - g_log->log_component[RRH].flag = LOG_MED; - g_log->log_component[RRH].interval = 1; - g_log->log_component[RRH].fd = 0; - g_log->log_component[RRH].filelog = 0; - g_log->log_component[RRH].filelog_name = ""; + g_log->level2string[LOG_EMERG] = "G"; //EMERG g_log->level2string[LOG_ALERT] = "A"; // ALERT @@ -666,16 +470,20 @@ int logInit (void) O_WRONLY | O_CREAT | O_APPEND, 0666); } } - + // set all unused component items to 0, they are for non predefined components + for (i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) { + memset(&(g_log->log_component[i]),0,sizeof(log_component_t)); + } printf("log init done\n"); return 0; } + extern int oai_exit; -void * log_mem_write(void) +void log_mem_write(void) { - int *fp; + int fp; char f_name[1024]; struct timespec slp_tm; slp_tm.tv_sec = 0; @@ -697,7 +505,11 @@ void * log_mem_write(void) } snprintf(f_name,1024, "%s_%d.log",log_mem_filename,log_mem_file_cnt); fp=open(f_name, O_WRONLY | O_CREAT, 0666); - write(fp, log_mem_d[log_mem_write_side].buf_p, log_mem_d[log_mem_write_side].buf_index); + int ret = write(fp, log_mem_d[log_mem_write_side].buf_p, log_mem_d[log_mem_write_side].buf_index); + if ( ret < 0) { + fprintf(stderr,"{LOG} %s %d Couldn't write in %s \n",__FILE__,__LINE__,f_name); + exit(EXIT_FAILURE); + } close(fp); log_mem_file_cnt++; log_mem_d[log_mem_write_side].buf_index=0; @@ -724,9 +536,9 @@ int logInit_log_mem (void) if ((pthread_mutex_init (&log_mem_lock, NULL) != 0) || (pthread_cond_init (&log_mem_notify, NULL) != 0)) { log_mem_d[1].enable_flag=0; - return; + return 0; } - pthread_create(&log_mem_thread, NULL, log_mem_write, (void*)NULL); + pthread_create(&log_mem_thread, NULL, (void *(*)(void *))log_mem_write, (void*)NULL); }else{ printf("log-mem single!!!\n"); log_mem_d[0].buf_p = malloc(LOG_MEM_SIZE); @@ -747,7 +559,7 @@ int logInit_log_mem (void) return 0; } -void nfapi_log(char *file, char *func, int line, int comp, int level, const char* format, va_list args) +void nfapi_log(const char *file, const char *func, int line, int comp, int level, const char* format,va_list args) { //logRecord_mt(file,func,line, pthread_self(), comp, level, format, ##args) int len = 0; @@ -764,6 +576,7 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char /* for no gcc warnings */ (void)log_start; (void)log_end; + c = &g_log->log_component[comp]; @@ -857,20 +670,8 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char // OAI printf compatibility if ((g_log->onlinelog == 1) && (level != LOG_FILE)) -#ifdef RTAI - if (len > MAX_LOG_TOTAL) { - rt_printk ("[OPENAIR] FIFO_PRINTF WROTE OUTSIDE ITS MEMORY BOUNDARY : ERRORS WILL OCCUR\n"); - } - - if (len > 0) { - rtf_put (FIFO_PRINTF_NO, log_buffer, len); - } - -#else - fwrite(log_buffer, len, 1, stdout); -#endif + fwrite(log_buffer, len, 1, stdout); -#ifndef RTAI if (g_log->syslog) { syslog(g_log->level, "%s", log_buffer); @@ -888,14 +689,6 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char } } -#else - - // online print messges - if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) { - printf(log_buffer); - } - -#endif #if defined(ENABLE_ITTI) @@ -1039,6 +832,13 @@ void nfapi_log(char *file, char *func, int line, int comp, int level, const char #endif } +void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char* format, ... ) +{ + va_list args; + va_start(args, format); + nfapi_log(file,func,line,comp,level, format,args); +} + //log record: add to a list void logRecord(const char *file, const char *func, int line, int comp, int level, const char *format, ...) @@ -1238,315 +1038,7 @@ void *log_thread_function(void *list) } #endif -//log record, format, and print: executed in the main thread (mt) -void logRecord_mt(const char *file, const char *func, int line, int comp, - int level, const char *format, ...) -{ - int len = 0; - va_list args; - log_component_t *c; - char *log_start; - char *log_end; - /* The main difference with the version above is the use of this local log_buffer. - * The other difference is the return value of snprintf which was not used - * correctly. It was not a big problem because in practice MAX_LOG_TOTAL is - * big enough so that the buffer is never full. - */ - char log_buffer[MAX_LOG_TOTAL]; - int temp_index; - - /* for no gcc warnings */ - (void)log_start; - (void)log_end; - - c = &g_log->log_component[comp]; - - // do not apply filtering for LOG_F - // only log messages which are enabled and are below the global log level and component's level threshold - if ((level != LOG_FILE) && ((level > c->level) || (level > g_log->level))) { - /* if ((level != LOG_FILE) && - ((level > c->level) || - (level > g_log->level) || - ( c->level > g_log->level))) { - */ - return; - } - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, - VCD_FUNCTION_IN); - - va_start(args, format); - - // adjust syslog level for TRACE messages - if (g_log->syslog) { - if (g_log->level > LOG_DEBUG) { - g_log->level = LOG_DEBUG; - } - } - - // make sure that for log trace the extra info is only printed once, reset when the level changes - if ((level == LOG_FILE) || (c->flag == LOG_NONE) || (level == LOG_TRACE)) { - log_start = log_buffer; - len = vsnprintf(log_buffer, MAX_LOG_TOTAL, format, args); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - log_end = log_buffer + len; - } else { - if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s", - log_level_highlight_start[level]); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - - log_start = log_buffer + len; - - if ( (g_log->flag & FLAG_COMP) || (c->flag & FLAG_COMP) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", - g_log->log_component[comp].name); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - if ( (g_log->flag & FLAG_LEVEL) || (c->flag & FLAG_LEVEL) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", - g_log->level2string[level]); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - - if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) { -# define THREAD_NAME_LEN 128 - char threadname[THREAD_NAME_LEN]; - if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0) - { - perror("pthread_getname_np : "); - } else { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } -# undef THREAD_NAME_LEN - } - - if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ", - func); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - - if ( (g_log->flag & FLAG_FILE_LINE) || (c->flag & FLAG_FILE_LINE) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s:%d]", - file, line); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - - len += vsnprintf(&log_buffer[len], MAX_LOG_TOTAL - len, format, args); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - log_end = log_buffer + len; - - if ( (g_log->flag & FLAG_COLOR) || (c->flag & FLAG_COLOR) ) { - len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "%s", - log_level_highlight_end[level]); - if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL; - } - } - - va_end(args); - - // OAI printf compatibility - if ((g_log->onlinelog == 1) && (level != LOG_FILE)) - if(log_mem_flag==1){ - if(log_mem_d[log_mem_side].enable_flag==1){ - temp_index=log_mem_d[log_mem_side].buf_index; - if(temp_index+len+1 < LOG_MEM_SIZE){ - log_mem_d[log_mem_side].buf_index+=len; - memcpy(&log_mem_d[log_mem_side].buf_p[temp_index],log_buffer,len); - }else{ - log_mem_d[log_mem_side].enable_flag=0; - if(log_mem_d[1-log_mem_side].enable_flag==1){ - temp_index=log_mem_d[1-log_mem_side].buf_index; - if(temp_index+len+1 < LOG_MEM_SIZE){ - log_mem_d[1-log_mem_side].buf_index+=len; - log_mem_side=1-log_mem_side; - memcpy(&log_mem_d[log_mem_side].buf_p[temp_index],log_buffer,len); - /* write down !*/ - if (pthread_mutex_lock(&log_mem_lock) != 0) { - return; - } - if(log_mem_write_flag==0){ - log_mem_write_side=1-log_mem_side; - if(pthread_cond_signal(&log_mem_notify) != 0) { - } - } - if(pthread_mutex_unlock(&log_mem_lock) != 0) { - return; - } - }else{ - log_mem_d[1-log_mem_side].enable_flag=0; - } - } - } - } - }else{ - fwrite(log_buffer, len, 1, stdout); - } - - if (g_log->syslog) { - syslog(g_log->level, "%s", log_buffer); - } - - if (g_log->filelog) { - if (write(gfd, log_buffer, len) < len) { - // TODO assert ? - } - } - - if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) { - if (write(g_log->log_component[comp].fd, log_buffer, len) < len) { - // TODO assert ? - } - } - -#if defined(ENABLE_ITTI) - - if (level <= LOG_DEBUG) { - task_id_t origin_task_id = TASK_UNKNOWN; - MessagesIds messages_id; - MessageDef *message_p; - size_t message_string_size; - char *message_msg_p; - - message_string_size = log_end - log_start; - -#if !defined(DISABLE_ITTI_DETECT_SUB_TASK_ID) - - /* Try to identify sub task ID from log information (comp, log_instance_type) */ - switch (comp) { - case PHY: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_PHY_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_PHY_UE; - break; - - default: - break; - } - - break; - - case MAC: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_MAC_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_MAC_UE; - - default: - break; - } - - break; - - case RLC: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_RLC_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_RLC_UE; - - default: - break; - } - - break; - - case PDCP: - switch (log_instance_type) { - case LOG_INSTANCE_ENB: - origin_task_id = TASK_PDCP_ENB; - break; - - case LOG_INSTANCE_UE: - origin_task_id = TASK_PDCP_UE; - - default: - break; - } - - break; - - default: - break; - } - -#endif - - switch (level) { - case LOG_EMERG: - case LOG_ALERT: - case LOG_CRIT: - case LOG_ERR: - messages_id = ERROR_LOG; - break; - - case LOG_WARNING: - messages_id = WARNING_LOG; - break; - - case LOG_NOTICE: - messages_id = NOTICE_LOG; - break; - - case LOG_INFO: - messages_id = INFO_LOG; - break; - - default: - messages_id = DEBUG_LOG; - break; - } - - message_p = itti_alloc_new_message_sized(origin_task_id, messages_id, message_string_size); - - switch (level) { - case LOG_EMERG: - case LOG_ALERT: - case LOG_CRIT: - case LOG_ERR: - message_msg_p = (char *) &message_p->ittiMsg.error_log; - break; - - case LOG_WARNING: - message_msg_p = (char *) &message_p->ittiMsg.warning_log; - break; - - case LOG_NOTICE: - message_msg_p = (char *) &message_p->ittiMsg.notice_log; - break; - - case LOG_INFO: - message_msg_p = (char *) &message_p->ittiMsg.info_log; - break; - - default: - message_msg_p = (char *) &message_p->ittiMsg.debug_log; - break; - } - - memcpy(message_msg_p, log_start, message_string_size); - - itti_send_msg_to_task(TASK_UNKNOWN, INSTANCE_DEFAULT, message_p); - } - -#endif - - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LOG_RECORD, - VCD_FUNCTION_OUT); -} int set_log(int component, int level, int interval) { @@ -1706,8 +1198,7 @@ void log_set_instance_type (log_instance_type_t instance) #endif void output_log_mem(void){ - int cnt,cnt2; - int *fp; + int fp; char f_name[1024]; if(log_mem_flag==1){ @@ -1720,18 +1211,30 @@ void output_log_mem(void){ if(log_mem_multi==1){ snprintf(f_name,1024, "%s_%d.log",log_mem_filename,log_mem_file_cnt); fp=open(f_name, O_WRONLY | O_CREAT, 0666); - write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); + int ret = write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); + if ( ret < 0) { + fprintf(stderr,"{LOG} %s %d Couldn't write in %s \n",__FILE__,__LINE__,f_name); + exit(EXIT_FAILURE); + } close(fp); free(log_mem_d[0].buf_p); snprintf(f_name,1024, "%s_%d.log",log_mem_filename,log_mem_file_cnt); fp=open(f_name, O_WRONLY | O_CREAT, 0666); - write(fp, log_mem_d[1].buf_p, log_mem_d[1].buf_index); + ret = write(fp, log_mem_d[1].buf_p, log_mem_d[1].buf_index); + if ( ret < 0) { + fprintf(stderr,"{LOG} %s %d Couldn't write in %s \n",__FILE__,__LINE__,f_name); + exit(EXIT_FAILURE); + } close(fp); free(log_mem_d[1].buf_p); }else{ fp=open(log_mem_filename, O_WRONLY | O_CREAT, 0666); - write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); + int ret = write(fp, log_mem_d[0].buf_p, log_mem_d[0].buf_index); + if ( ret < 0) { + fprintf(stderr,"{LOG} %s %d Couldn't write in %s \n",__FILE__,__LINE__,log_mem_filename); + exit(EXIT_FAILURE); + } close(fp); free(log_mem_d[0].buf_p); } diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index d40d24591a1f74a30f7caedb4dba2123148ef898..9a89b7f0c0052a5d0f9e4087d613a7e574ec18ef 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -186,10 +186,13 @@ typedef enum { LOCALIZE, RRH, X2AP, - MAX_LOG_COMPONENTS, + LOADER, + MAX_LOG_PREDEF_COMPONENTS, } comp_name_t; +#define MAX_LOG_DYNALLOC_COMPONENTS 20 +#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS) //#define msg printf typedef struct { @@ -231,6 +234,7 @@ typedef struct { int syslog; int filelog; char* filelog_name; + int async; // asynchronous mode, via dedicated log thread + log buffer } log_t; typedef struct LOG_params { @@ -289,16 +293,15 @@ char *map_int_to_str(mapping *map, int val); void logClean (void); int is_newline( char *str, int size); void *log_thread_function(void * list); - +int register_log_component(char *name, char *fext, int compidx); /** @defgroup _logIt logIt function * @ingroup _macro * @brief Macro used to call tr_log_full_ex with file, function and line information * @{*/ -#ifdef LOG_NO_THREAD + #define logIt(component, level, format, args...) (g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0) -#else //default -#define logIt(component, level, format, args...) (g_log->log_component[component].interval?logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0) -#endif +#define logItS(component, level, format, args...) (g_log->log_component[component].interval?logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0) + /* @}*/ /*!\fn int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format); @@ -323,15 +326,16 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int #define LOG_CONFIG_LEVEL_FORMAT "%s_log_level" #define LOG_CONFIG_VERBOSITY_FORMAT "%s_log_verbosity" #define LOG_CONFIG_LOGFILE_FORMAT "%s_log_infile" + /*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /* LOG globalconfiguration parameters */ -/* optname helpstr paramflags XXXptr defXXXval type numelt */ +/* optname help paramflags XXXptr defXXXval type numelt */ /*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/ #define LOG_GLOBALPARAMS_DESC { \ -{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ -{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \ -{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0, }, \ -{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0, }, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0}, \ +{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0}, \ } /*----------------------------------------------------------------------------------*/ /** @defgroup _debugging debugging macros @@ -339,20 +343,20 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int * @brief Macro used to call logIt function with different message levels * @{*/ -// debugging macros +// debugging macros(g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0) # if T_TRACER # include "T.h" -# define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) -# define LOG_W(c, x...) T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) -# define LOG_E(c, x...) T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) -# define LOG_D(c, x...) T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) -# define LOG_T(c, x...) T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) -# define LOG_G(c, x...) /* */ -# define LOG_A(c, x...) /* */ -# define LOG_C(c, x...) /* */ -# define LOG_N(c, x...) /* */ -# define LOG_F(c, x...) /* */ -# define LOG_M(file, vector, data, len, dec, format) /* */ +# define LOG_I(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0) +# define LOG_W(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0) +# define LOG_E(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0) +# define LOG_D(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0) +# define LOG_T(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0) +# define LOG_G(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_EMERG, x) ;}} while (0) /* */ +# define LOG_A(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_ALERT, x) ;}} while (0) /* */ +# define LOG_C(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_CRIT, x) ;}} while (0) /* */ +# define LOG_N(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_NOTICE, x) ;}} while (0) /* */ +# define LOG_F(c, x...) do { if (T_active[c] == T_ACTIVE_STDOUT) { logIt(c, LOG_FILE, x) ;}} while (0) /* */ +# define LOG_M(file, vector, data, len, dec, format) write_file_matlab(file, vector, data, len, dec, format)/* */ # else /* T_TRACER */ # if DISABLE_LOG_X # define LOG_I(c, x...) /* */ diff --git a/openair2/UTIL/MEM/mem_block.h b/openair2/UTIL/MEM/mem_block.h index e9673802698fac9094f450c0e858e341a67ab197..a0455899e3a3cfeb23f936c8fb03c2a289c5fa72 100644 --- a/openair2/UTIL/MEM/mem_block.h +++ b/openair2/UTIL/MEM/mem_block.h @@ -32,13 +32,7 @@ # define __MEM_BLOCK_H__ #include <stdint.h> -#ifdef MEM_BLOCK_C -# define public_mem_block(x) x -# define private_mem_block(x) x -#else -# define public_mem_block(x) extern x -# define private_mem_block(x) -#endif +#include "openair2/COMMON/platform_constants.h" //----------------------------------------------------------------------------- typedef struct mem_block_t { @@ -47,21 +41,20 @@ typedef struct mem_block_t { unsigned char pool_id; unsigned char *data; } mem_block_t; -#include "UTIL/LISTS/list.h" //----------------------------------------------------------------------------- -public_mem_block(void *pool_buffer_init (void);) -public_mem_block(void *pool_buffer_clean (void *arg);) -public_mem_block(void free_mem_block (mem_block_t * leP, const char* caller);) -public_mem_block(mem_block_t* get_free_mem_block (uint32_t sizeP, const char* caller);) -public_mem_block(mem_block_t *get_free_copy_mem_block (void);) -public_mem_block(mem_block_t *get_free_copy_mem_block_up (void);) -public_mem_block(mem_block_t *copy_mem_block (mem_block_t * leP, mem_block_t * destP);) -public_mem_block(void display_mem_load (void);) - -public_mem_block(void check_mem_area (void);) -private_mem_block(void check_free_mem_block (mem_block_t * leP);) +void *pool_buffer_init (void); +void *pool_buffer_clean (void *arg); +void free_mem_block (mem_block_t * leP, const char* caller); +mem_block_t* get_free_mem_block (uint32_t sizeP, const char* caller); +mem_block_t *get_free_copy_mem_block (void); +mem_block_t *get_free_copy_mem_block_up (void); +mem_block_t *copy_mem_block (mem_block_t * leP, mem_block_t * destP); +void display_mem_load (void); + +void check_mem_area (void); +void check_free_mem_block (mem_block_t * leP); # define MEM_SCALE MAX_MOBILES_PER_ENB // definition of the size of the allocated memory area # define MEM_MNGT_MB0_BLOCK_SIZE 64 @@ -139,9 +132,26 @@ private_mem_block(void check_free_mem_block (mem_block_t * leP);) # define MEM_MNGT_NB_ELEMENTS MEM_MNGT_MB0_NB_BLOCKS + MEM_MNGT_MB1_NB_BLOCKS + MEM_MNGT_MB2_NB_BLOCKS + MEM_MNGT_MB3_NB_BLOCKS + MEM_MNGT_MB4_NB_BLOCKS + MEM_MNGT_MB5_NB_BLOCKS + MEM_MNGT_MB6_NB_BLOCKS + MEM_MNGT_MB7_NB_BLOCKS + MEM_MNGT_MB8_NB_BLOCKS + MEM_MNGT_MB9_NB_BLOCKS + MEM_MNGT_MB10_NB_BLOCKS + MEM_MNGT_MB11_NB_BLOCKS + MEM_MNGT_MB12_NB_BLOCKS + MEM_MNGT_MBCOPY_NB_BLOCKS # define MEM_MNGT_POOL_ID_COPY 13 +#define LIST_NAME_MAX_CHAR 32 + + +typedef struct { + struct mem_block_t *head; + struct mem_block_t *tail; + int nb_elements; + char name[LIST_NAME_MAX_CHAR]; +} list2_t; +//----------------------------------------------------------------------------- +typedef struct { + struct mem_block_t *head; + struct mem_block_t *tail; + int nb_elements; + char name[LIST_NAME_MAX_CHAR]; +} list_t; + -private_mem_block(typedef struct { +typedef struct { //----------------------------------------------------------- // basic memory management //----------------------------------------------------------- @@ -161,9 +171,9 @@ private_mem_block(typedef struct { mem_block_t mem_blocks[MEM_MNGT_NB_ELEMENTS]; list_t mem_lists[14]; -} mem_pool;) +} mem_pool; -private_mem_block(mem_pool mem_block_var;) +mem_pool mem_block_var; #endif diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index cbe0f7d0d810dbf795b2c6e5e556dc0cd4acc059..d75aa9a57442442cc76a1fdabbf9c82088f857e2 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -266,8 +266,8 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam TICK_TO_US(eNB->phy_proc_tx), TICK_TO_US(eNB->phy_proc_rx), TICK_TO_US(eNB->rx_prach), - TICK_TO_US(eNB->ofdm_mod_stats), - softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now); + TICK_TO_US(eNB->ofdm_mod_stats) + ); LOG_D(PHY, "dlsch[enc:%lld mod:%lld scr:%lld rm:%lld t:%lld i:%lld] rx_dft:%lld ", TICK_TO_US(eNB->dlsch_encoding_stats), diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index b03b995463391950fdcb29c0b1d92fa4b3ec7179..5d60928cd13cb6d09dfcfd807292ba21c08c068b 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -912,6 +912,9 @@ void tx_rf(RU_t *ru) { flags=2; // start burst late_control=STATE_BURST_NORMAL; break; + default: + LOG_D(PHY,"[TXPATH] RU %d late_control %d not implemented\n",ru->idx, late_control); + break; } } /* add fail safe for late command end */ @@ -1585,9 +1588,6 @@ static void* ru_thread( void* param ) { dlsch_ue_select_tbl_in_use = 1; #endif - struct timespec time_req, time_rem; - time_req.tv_sec = 0; - time_req.tv_nsec = 10000; // set default return value thread_top_init("ru_thread",1,400000,500000,500000); @@ -1796,6 +1796,10 @@ static void* ru_thread( void* param ) { } } #else + struct timespec time_req, time_rem; + time_req.tv_sec = 0; + time_req.tv_nsec = 10000; + while((!oai_exit)&&(phy_tx_end == 0)){ nanosleep(&time_req,&time_rem); continue; @@ -2766,7 +2770,7 @@ void init_RU(char *rf_config_file) { void stop_ru(RU_t *ru) { - int *status; + printf("Stopping RU %p processing threads\n",(void*)ru); #if defined(PRE_SCD_THREAD) if(ru){ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 73f5797327198d49f2daf9a1959d13058514a811..dac53fc3f05d2267c35dac51126d261808a851d3 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -566,10 +566,7 @@ static void get_options(void) { logInit_log_mem(); } -#if T_TRACER - paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ; - config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL); -#endif + if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) ) { memset((void*)&RC,0,sizeof(RC)); @@ -590,11 +587,6 @@ static void get_options(void) { } -#if T_TRACER -int T_nowait = 0; /* by default we wait for the tracer */ -int T_port = 2021; /* default port to listen to to wait for the tracer */ -int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ -#endif @@ -969,7 +961,7 @@ int main( int argc, char **argv ) #if T_TRACER - T_init(T_port, 1-T_nowait, T_dont_fork); + T_Config_Init(); #endif diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 8aae82faf0622bfbeda1696154985b164fa0aa3c..10e9d420ff0fd424f7f1ffdbdc28db12ac408d84 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -209,21 +209,6 @@ #define CMDLINE_STARTTELN_IDX 3 -extern int T_port; -extern int T_nowait; -extern int T_dont_fork; - -/*------------------------------------------------------------------------------------------------------------------------------------------*/ -/* command line 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:0, 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:1, TYPE_INT, 0}, \ -} - - /***************************************************************************************************************************************/ /* */ extern pthread_cond_t sync_cond; diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 46d47e076c9f22196f7f97aac3224365499bf273..27fe6ebe8a82f13be983d9e5bdfde1b16a656214 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -578,10 +578,6 @@ static void get_options(void) { tx_gain[0][CC_id] = tx_gain[0][0]; } -#if T_TRACER - paramdef_t cmdline_ttraceparams[] =CMDLINE_TTRACEPARAMS_DESC ; - config_process_cmdline( cmdline_ttraceparams,sizeof(cmdline_ttraceparams)/sizeof(paramdef_t),NULL); -#endif if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) { // Here the configuration file is the XER encoded UE capabilities @@ -594,14 +590,6 @@ static void get_options(void) { } -#if T_TRACER -int T_nowait = 0; /* by default we wait for the tracer */ -int T_port = 2021; /* default port to listen to to wait for the tracer */ -int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ -#endif - - - void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) { int CC_id; @@ -841,7 +829,7 @@ int main( int argc, char **argv ) #if T_TRACER - T_init(T_port, 1-T_nowait, T_dont_fork); + T_Config_Init(); #endif diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 659463e8bcbc965a5fd19cd1d9dfc9bedac9c88b..c37a95a95a10cc9d129b458b1b289fdd80313bb2 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -283,11 +283,6 @@ help (void) printf ("-Z Reserved\n"); printf ("--xforms Activate the grapical scope\n"); -#if T_TRACER - printf ("--T_port [port] use given port\n"); - printf ("--T_nowait don't wait for tracer, start immediately\n"); - printf ("--T_dont_fork to ease debugging with gdb\n"); -#endif } pthread_t log_thread; @@ -993,12 +988,6 @@ int restart_L1L2(int enb_id) return 0; } -#if T_TRACER -int T_wait = 1; /* by default we wait for the tracer */ -int T_port = 2021; /* default port to listen to to wait for the tracer */ -int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */ -#endif - void wait_RUs(void) { @@ -1120,7 +1109,7 @@ int main (int argc, char **argv) get_simulation_options (argc, argv); //Command-line options #if T_TRACER - T_init(T_port, T_wait, T_dont_fork); + T_Config_Init(); #endif // Initialize VCD LOG module diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 3bc180a014c2495630173dc6fd8e8ad80e42298f..c159f113715d32fb3481d3accd5a6cac2fedca93 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -198,11 +198,6 @@ void get_simulation_options(int argc, char *argv[]) LONG_OPTION_PHYTEST, LONG_OPTION_XFORMS, -#if T_TRACER - LONG_OPTION_T_PORT, - LONG_OPTION_T_NOWAIT, - LONG_OPTION_T_DONT_FORK, -#endif }; static struct option long_options[] = { @@ -237,12 +232,6 @@ void get_simulation_options(int argc, char *argv[]) {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST}, {"xforms", no_argument, 0, LONG_OPTION_XFORMS}, -#if T_TRACER - {"T_port", required_argument, 0, LONG_OPTION_T_PORT}, - {"T_nowait", no_argument, 0, LONG_OPTION_T_NOWAIT}, - {"T_dont_fork", no_argument, 0, LONG_OPTION_T_DONT_FORK}, -#endif - {NULL, 0, NULL, 0} }; @@ -410,26 +399,6 @@ void get_simulation_options(int argc, char *argv[]) xforms=1; break; -#if T_TRACER - case LONG_OPTION_T_PORT: { - extern int T_port; - if (optarg == NULL) abort(); /* should not happen */ - T_port = atoi(optarg); - break; - } - - case LONG_OPTION_T_NOWAIT: { - extern int T_wait; - T_wait = 0; - break; - } - - case LONG_OPTION_T_DONT_FORK: { - extern int T_dont_fork; - T_dont_fork = 1; - break; - } -#endif case 'a': abstraction_flag = 1;