From cbbefb5973a6403266b89d1dd86f43160c4bb00f Mon Sep 17 00:00:00 2001 From: Florian Kaltenberger <florian.kaltenberger@eurecom.fr> Date: Tue, 1 Oct 2013 16:38:00 +0000 Subject: [PATCH] forgot to commit openair2 git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4175 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair2/LAYER2/MAC/eNB_scheduler.c | 10 +++++++--- openair2/LAYER2/MAC/ue_procedures.c | 12 ++++++++---- openair2/LAYER2/PDCP_v10.1.0/pdcp.h | 2 +- openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c | 14 +++++++++----- openair2/RRC/LITE/MESSAGES/Makefile.inc | 2 +- openair2/UTIL/LOG/vcd_signal_dumper.c | 4 ++++ openair2/UTIL/LOG/vcd_signal_dumper.h | 4 ++++ 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 9f6fa95b4bf..d9375209c18 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -4191,6 +4191,7 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf unsigned int nCCE=0; int mbsfn_status=0; u32 RBalloc=0; + int ret; DCI_PDU *DCI_pdu= &eNB_mac_inst[Mod_id].DCI_pdu; // LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler\n",Mod_id, frame, subframe); @@ -4213,8 +4214,12 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf #ifdef EXMIMO //pdcp_run(frame, 1, 0, Mod_id); - if (pthread_mutex_lock (&pdcp_mutex) != 0) { - LOG_E(PDCP,"Cannot lock mutex\n"); + ret = pthread_mutex_trylock (&pdcp_mutex); + if (ret != 0) { + if (ret==EBUSY) + LOG_E(PDCP,"Mutex busy\n"); + else + LOG_E(PDCP,"Cannot lock mutex\n"); //return(-1); } else { @@ -4231,7 +4236,6 @@ void eNB_dlsch_ulsch_scheduler(u8 Mod_id,u8 cooperation_flag, u32 frame, u8 subf LOG_W(PDCP,"PDCP thread busy!!! inst_cnt=%d\n",pdcp_instance_cnt); } } - #endif #ifdef CELLULAR rrc_rx_tx(Mod_id, frame, 0, 0); diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index 5bd0d904aca..22eb40fa8ce 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -1272,7 +1272,8 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire // mac_rlc_status_resp_t rlc_status[MAX_NUM_LCGID]; // 4 // s8 lcg_id; struct RACH_ConfigCommon *rach_ConfigCommon = (struct RACH_ConfigCommon *)NULL; - + int ret; + vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SCHEDULER, VCD_FUNCTION_IN); //Mac_rlc_xface->frame=frame; @@ -1281,8 +1282,12 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire #ifdef EXMIMO //pdcp_run(frame, 0, Mod_id, eNB_index); - if (pthread_mutex_lock (&pdcp_mutex) != 0) { - LOG_E(PDCP,"Cannot lock mutex\n"); + ret = pthread_mutex_trylock (&pdcp_mutex); + if (ret != 0) { + if (ret==EBUSY) + LOG_E(PDCP,"Mutex busy\n"); + else + LOG_E(PDCP,"Cannot lock mutex\n"); //return(-1); } else { @@ -1299,7 +1304,6 @@ UE_L2_STATE_t ue_scheduler(u8 Mod_id,u32 frame, u8 subframe, lte_subframe_t dire LOG_W(PDCP,"PDCP thread busy!!! inst_cnt=%d\n",pdcp_instance_cnt); } } - #endif UE_mac_inst[Mod_id].frame = frame; UE_mac_inst[Mod_id].subframe = subframe; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h index 06e4420db3f..acede3b5ce6 100755 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h @@ -92,7 +92,7 @@ extern pthread_cond_t pdcp_cond; extern int pdcp_instance_cnt; static void *pdcp_thread_main(void* param); -int init_pdcp_thread(u8 eNB_flag); +int init_pdcp_thread(void); void cleanup_pdcp_thread(void); typedef unsigned char BOOL; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c index 8c2b37bb6ce..9aff9de7d36 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c @@ -49,6 +49,7 @@ #define OPENAIR_THREAD_PRIORITY 255 extern int oai_exit; +extern char UE_flag; pthread_t pdcp_thread; pthread_attr_t pdcp_thread_attr; @@ -58,7 +59,10 @@ int pdcp_instance_cnt; static void *pdcp_thread_main(void* param) { - u8 eNB_flag = *((u8*)param); + //u8 eNB_flag = *((u8*)param); + u8 eNB_flag = !UE_flag; + + LOG_I(PDCP,"This is pdcp_thread eNB_flag = %d\n",eNB_flag); while (!oai_exit) { @@ -78,11 +82,11 @@ static void *pdcp_thread_main(void* param) { if (eNB_flag) { pdcp_run(PHY_vars_eNB_g[0]->frame, eNB_flag, PHY_vars_eNB_g[0]->Mod_id, 0); - //LOG_I(PDCP,"Calling pdcp_run (eNB) for frame %d\n",PHY_vars_eNB_g[0]->frame); + LOG_D(PDCP,"Calling pdcp_run (eNB) for frame %d\n",PHY_vars_eNB_g[0]->frame); } else { pdcp_run(PHY_vars_UE_g[0]->frame, eNB_flag, 0, PHY_vars_UE_g[0]->Mod_id); - //LOG_I(PDCP,"Calling pdcp_run (UE) for frame %d\n",PHY_vars_UE_g[0]->frame); + LOG_D(PDCP,"Calling pdcp_run (UE) for frame %d\n",PHY_vars_UE_g[0]->frame); } @@ -101,7 +105,7 @@ static void *pdcp_thread_main(void* param) { -int init_pdcp_thread(u8 eNB_flag) { +int init_pdcp_thread(void) { int error_code; struct sched_param p; @@ -123,7 +127,7 @@ int init_pdcp_thread(u8 eNB_flag) { error_code = pthread_create(&pdcp_thread, &pdcp_thread_attr, pdcp_thread_main, - (void*)(&eNB_flag)); + (void*)NULL); if (error_code!= 0) { LOG_I(PDCP,"Could not allocate PDCP thread, error %d\n",error_code); diff --git a/openair2/RRC/LITE/MESSAGES/Makefile.inc b/openair2/RRC/LITE/MESSAGES/Makefile.inc index ac838b419ba..99c767f921a 100644 --- a/openair2/RRC/LITE/MESSAGES/Makefile.inc +++ b/openair2/RRC/LITE/MESSAGES/Makefile.inc @@ -42,7 +42,7 @@ include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ASN_CONVERTER_SOURCES+=asn1_msg.c -EXTRA_CFLAGS += -I. -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES -g -ggdb #-DEMIT_ASN_DEBUG #-Wall +EXTRA_CFLAGS += -I. -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES ASN1_MODULE_OBJS=${ASN_MODULE_SOURCES:.c=.o} ASN1_CONVERTER_OBJS=${ASN_CONVERTER_SOURCES:.c=.o} diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index ed7410fd94d..6b6530557ed 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -148,6 +148,10 @@ const char* eurecomFunctionsNames[] = { "phy_enb_ulsch_decoding", "phy_ue_ulsch_modulation", "phy_ue_ulsch_encoding", + "phy_ue_ulsch_scramblig", + "phy_eNB_dlsch_modulation", + "phy_eNB_dlsch_encoding", + "phy_eNB_dlsch_scramblig", "pdcp_apply_security", "pdcp_validate_security", "test" diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 0b9d883d2d6..858274f05c9 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -120,6 +120,10 @@ typedef enum VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_SCRAMBLING, + VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, + VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_APPLY_SECURITY, VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_SIGNAL_DUMPER_FUNCTIONS_TEST, -- GitLab