diff --git a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf index 3df3faeb2f..90da72dcc5 100644 --- a/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf +++ b/ci-scripts/conf_files/rcc.band7.tm1.nfapi.conf @@ -226,18 +226,18 @@ THREAD_STRUCT = ( log_config = { - global_log_level ="debug"; + global_log_level ="info"; global_log_verbosity ="medium"; hw_log_level ="info"; hw_log_verbosity ="medium"; phy_log_level ="info"; phy_log_verbosity ="medium"; - mac_log_level ="debug"; + mac_log_level ="info"; mac_log_verbosity ="high"; rlc_log_level ="info"; rlc_log_verbosity ="medium"; pdcp_log_level ="info"; pdcp_log_verbosity ="medium"; - rrc_log_level ="debug"; + rrc_log_level ="info"; rrc_log_verbosity ="medium"; }; diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index bc7471122a..85c6242377 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -45,6 +45,7 @@ #include "common/config/config_userapi.h" #include #include + // main log variables log_mem_cnt_t log_mem_d[2]; @@ -477,29 +478,28 @@ char *log_getthreadname(char *threadname, } static int log_header(char *log_buffer, - int buffsize, - int comp, - int level, - const char *format) + int buffsize, + int comp, + int level, + const char *format) { char threadname[PR_SET_NAME]; struct timeval tv; gettimeofday(&tv, NULL); struct tm tm; localtime_r(&tv.tv_sec, &tm); - - return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s", - tm.tm_hour, - tm.tm_min, - tm.tm_sec, - tv.tv_usec, - log_level_highlight_end[level], - ((g_log->flag & FLAG_NOCOLOR) ? "" : log_level_highlight_start[level]), - g_log->log_component[comp].name, - ((g_log->flag & FLAG_LEVEL) ? g_log->level2string[level] : ' '), - ((g_log->flag & FLAG_THREAD) ? log_getthreadname(threadname, PR_SET_NAME + 1) : ""), - format, - log_level_highlight_end[level]); + return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s", + tm.tm_hour, + tm.tm_min, + tm.tm_sec, + tv.tv_usec, + log_level_highlight_end[level], + ( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]), + g_log->log_component[comp].name, + ( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:' '), + ( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""), + format, + log_level_highlight_end[level]); } void logRecord_mt(const char *file, diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 9e6e476639..887e79847e 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -106,14 +106,15 @@ extern "C" { #define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */ #define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */ #define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */ +#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */ #else -#define LOG_RED "" -#define LOG_GREEN "" -#define LOG_ORANGE "" -#define LOG_BLUE "" -#define LOG_CYBL "" -#define LOG_RESET "" -#endif +# define LOG_RED "" +# define LOG_GREEN "" +# define LOG_ORANGE "" +# define LOG_BLUE "" +# define LOG_CYBL "" +# define LOG_RESET "" +#endif // LOG_WITH_COLORS /* @}*/ diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 0a20a9b45e..69d97f48d4 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -423,7 +423,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, if (RC.eNB && RC.eNB[0][0]->configured) { uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf); uint16_t sf = NFAPI_SFNSF2SF(sfn_sf); - LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf); + //LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf); wake_eNB_rxtx(RC.eNB[0][0], sfn, sf); } else { printf("[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB); @@ -439,9 +439,6 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles); pthread_mutex_lock(&eNB->UL_INFO_mutex); - - LOG_E(MAC, "%s entered\n", __func__); - if(NFAPI_MODE == NFAPI_MODE_VNF){ int8_t index = -1; for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ @@ -504,9 +501,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indication_t *ind) { struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; - LOG_D(MAC, "%s() NFAPI Frame: %d Subframe: %d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf), - NFAPI_SFNSF2SF(ind->sfn_sf), ind->harq_indication_body.number_of_harqs); - LOG_E(MAC, "%s entered\n", __func__); + LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs); pthread_mutex_lock(&eNB->UL_INFO_mutex); if(NFAPI_MODE == NFAPI_MODE_VNF){ int8_t index = -1; @@ -544,10 +539,6 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_t *ind) { struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; pthread_mutex_lock(&eNB->UL_INFO_mutex); - -LOG_E(MAC, "%s entered sfn: %u sf: %u\n", __func__, NFAPI_SFNSF2SFN(ind->sfn_sf), - NFAPI_SFNSF2SF(ind->sfn_sf)); - if(NFAPI_MODE == NFAPI_MODE_VNF){ int8_t index = -1; for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){ @@ -612,8 +603,6 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus); } - LOG_E(MAC, "%s entered sfn: %u sf: %u\n", __func__, NFAPI_SFNSF2SFN(ind->sfn_sf), - NFAPI_SFNSF2SF(ind->sfn_sf)); pthread_mutex_lock(&eNB->UL_INFO_mutex); if(NFAPI_MODE == NFAPI_MODE_VNF){ int8_t index = -1; @@ -751,7 +740,6 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_ //mac_cqi_ind(p7_vnf->mac, ind); struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0]; LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis); - LOG_E(MAC, "%s entered\n", __func__); pthread_mutex_lock(&eNB->UL_INFO_mutex); if(NFAPI_MODE == NFAPI_MODE_VNF){ int8_t index = -1; diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h index 48b4c2d0c3..32a31a99f6 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h @@ -2566,7 +2566,7 @@ typedef struct { } nfapi_harq_indication_tdd_rel13_t; #define NFAPI_HARQ_INDICATION_TDD_REL13_TAG 0x204F -typedef struct { +typedef struct { nfapi_tl_t tl; uint8_t harq_tb1; uint8_t harq_tb2; diff --git a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c index 414c38aa35..be9205d035 100755 --- a/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c +++ b/nfapi/open-nFAPI/nfapi/src/nfapi_p7.c @@ -1553,11 +1553,11 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, if (pdu->segments[j].segment_length == 3) { - // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, - // pdu->segments[j].segment_data[0], - // pdu->segments[j].segment_data[1], - // pdu->segments[j].segment_data[2] - // ); + NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, + pdu->segments[j].segment_data[0], + pdu->segments[j].segment_data[1], + pdu->segments[j].segment_data[2] + ); } //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret); @@ -4502,11 +4502,11 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void * return 0; if (pdu->segments[0].segment_length == 3) { - // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, - // pdu->segments[0].segment_data[0], - // pdu->segments[0].segment_data[1], - // pdu->segments[0].segment_data[2] - // ); + NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, + pdu->segments[0].segment_data[0], + pdu->segments[0].segment_data[1], + pdu->segments[0].segment_data[2] + ); } } else diff --git a/openair1/PHY/LTE_UE_TRANSPORT/sldch.c b/openair1/PHY/LTE_UE_TRANSPORT/sldch.c index 48d641c232..8769d5f81b 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/sldch.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/sldch.c @@ -49,10 +49,10 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx) (void*)sldch, sizeof(SLDCH_t)); -// LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n", -// sizeof(SLDCH_t)-sizeof(uint8_t*), -// sldch->payload_length, -// sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length); + LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n", + sizeof(SLDCH_t)-sizeof(uint8_t*), + sldch->payload_length, + sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length); multicast_link_write_sock(0, (char *)&pdu, diff --git a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c index 9d49bbe8e9..5ffea3d36e 100644 --- a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c +++ b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c @@ -242,9 +242,9 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP) if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0, (struct sockaddr *) &group_list[groupP].sock_remote_addr, sizeof (group_list[groupP].sock_remote_addr))) < 0) { - // LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n", - // errno, strerror(errno), - // __FILE__, __LINE__); + LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n", + errno, strerror(errno), + __FILE__, __LINE__); } return num; diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c index d8fe240cb4..237560917a 100644 --- a/openair2/LAYER2/MAC/ra_procedures.c +++ b/openair2/LAYER2/MAC/ra_procedures.c @@ -200,7 +200,6 @@ get_prach_resources(module_id_t module_idP, RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER = get_Po_NOMINAL_PUSCH(module_idP, CC_id); } else { // Msg3 is being retransmitted - LOG_E(MAC, "Didnt set UE Mode Correctly\n"); if (UE_mac_inst[module_idP].RA_usedGroupA == 1) { if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) { UE_mac_inst[module_idP].RA_prach_resources. @@ -289,8 +288,6 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, uint8_t Size = 0; UE_MODE_t UE_mode; - LOG_D(MAC, "got inside ue_get_rach\n"); - // Modification for phy_stub_ue operation if(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) { // phy_stub_ue mode UE_mode = UE_mac_inst[module_idP].UE_mode[0]; @@ -322,7 +319,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, } if (UE_mac_inst[module_idP].RA_active == 0) { - LOG_D(MAC, "RA not active\n"); + LOG_I(MAC, "RA not active\n"); // check if RRC is ready to initiate the RA procedure Size = mac_rrc_data_req_ue(module_idP, CC_id, @@ -335,10 +332,10 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id, 0); Size16 = (uint16_t) Size; // LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size); - LOG_D(RRC, + LOG_I(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", frameP, module_idP, eNB_indexP, module_idP); - LOG_D(MAC, + LOG_I(MAC, "[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", module_idP, frameP, Size); diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c index fca1d1b2f5..531aee0267 100644 --- a/openair2/LAYER2/MAC/ue_procedures.c +++ b/openair2/LAYER2/MAC/ue_procedures.c @@ -2468,11 +2468,11 @@ ue_scheduler(const module_id_t module_idP, if (msg_p != NULL) { switch (ITTI_MSG_ID(msg_p)) { case RRC_MAC_CCCH_DATA_REQ: - // LOG_I(MAC, - // "Received %s from %s: instance %d, frameP %d, eNB_index %d\n", - // ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p), - // RRC_MAC_CCCH_DATA_REQ(msg_p).frame, - // RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index); + LOG_I(MAC, + "Received %s from %s: instance %d, frameP %d, eNB_index %d\n", + ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p), + RRC_MAC_CCCH_DATA_REQ(msg_p).frame, + RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index); // TODO process CCCH data req. break; @@ -3144,7 +3144,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t 0); if (sldch->payload_length >0 ) { - // LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch); + LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch); return (sldch); } else return((SLDCH_t *)NULL); diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index ce0652717e..7f10a19427 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -124,8 +124,6 @@ void fill_sr_indication_UE_MAC(int Mod_id, nfapi_ul_config_request_t *ul_config_req) { pthread_mutex_lock(&fill_ul_mutex.sr_mutex); - LOG_I(MAC, "Entered fill_sr_indication_UE_MAC\n"); - nfapi_sr_indication_t *sr_ind = &UL_INFO->sr_ind; nfapi_sr_indication_body_t *sr_ind_body = &sr_ind->sr_indication_body; nfapi_sr_indication_pdu_t *pdu = &sr_ind_body->sr_pdu_list[sr_ind_body->number_of_srs]; @@ -167,9 +165,6 @@ void fill_crc_indication_UE_MAC(int Mod_id, nfapi_ul_config_request_t *ul_config_req) { pthread_mutex_lock(&fill_ul_mutex.crc_mutex); - LOG_I(MAC, "Entered fill_crc_indication_UE_MAC Frame %d Subframe %d\n", - frame, subframe); - nfapi_crc_indication_pdu_t *pdu = &UL_INFO->crc_ind.crc_indication_body .crc_pdu_list[UL_INFO->crc_ind.crc_indication_body.number_of_crcs]; @@ -235,7 +230,7 @@ void fill_rach_indication_UE_MAC(int Mod_id, .preamble_rel13.rach_resource_type = 0; UL_INFO->rach_ind.rach_indication_body.preamble_list[0].instance_length = 0; - LOG_D(PHY, + LOG_I(PHY, "UE Filling NFAPI indication for RACH : TA %d, Preamble %d, rnti %x, " "rach_resource_type %d\n", UL_INFO->rach_ind.rach_indication_body.preamble_list[0] @@ -249,8 +244,6 @@ void fill_rach_indication_UE_MAC(int Mod_id, // This function is currently defined only in the nfapi-RU-RAU-split so we // should call it when we merge with that branch. - // TODO Andrew - send proxy specific socket instead of oai_nfapi_rach_ind Send the whole UL_INFO struct - // as soon as numberof preambles if (NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) { send_standalone_msg(UL_INFO, UL_INFO->rach_ind.header.message_id); } else { @@ -275,8 +268,6 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, &UL_INFO->cqi_ind.cqi_indication_body.cqi_raw_pdu_list [UL_INFO->cqi_ind.cqi_indication_body.number_of_cqis]; - LOG_I(MAC, "Entered fill_ulsch_cqi_indication_UE_MAC\n"); - UL_INFO->cqi_ind.sfn_sf = frame << 4 | subframe; // because of nfapi_vnf.c:733, set message id to 0, not // NFAPI_RX_CQI_INDICATION; @@ -316,8 +307,6 @@ void fill_ulsch_harq_indication_UE_MAC( nfapi_ul_config_request_t *ul_config_req) { pthread_mutex_lock(&fill_ul_mutex.harq_mutex); - LOG_I(MAC, "Entered fill_ulsch_harq_indication_UE_MAC\n"); - nfapi_harq_indication_pdu_t *pdu = &UL_INFO->harq_ind.harq_indication_body.harq_pdu_list [UL_INFO->harq_ind.harq_indication_body.number_of_harqs]; @@ -367,8 +356,6 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, &body->harq_pdu_list[UL_INFO->harq_ind.harq_indication_body .number_of_harqs]; - LOG_I(MAC, "Entered fill_uci_harq_indication_UE_MAC\n"); - UL_INFO->harq_ind.vendor_extension = ul_config_req->vendor_extension; ind->sfn_sf = frame << 4 | subframe; @@ -481,7 +468,8 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, UE_mac_inst[Mod_id].RA_prach_resources.Msg3, buflen, rnti, - index, ul_config_req); + index, + ul_config_req); Msg3_transmitted(Mod_id, 0, frame, 0); // Modification UE_mac_inst[Mod_id].UE_mode[0] = PUSCH; @@ -491,8 +479,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, // UE_mac_inst[Mod_id].first_ULSCH_Tx = 0; } else { ue_get_sdu(Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode); - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -520,8 +507,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, uint8_t access_mode = SCHEDULED_ACCESS; if (buflen > 0) { if (UE_mac_inst[Mod_id].first_ULSCH_Tx == 1) { // Msg3 case - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -538,8 +524,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, UE_mac_inst[Mod_id].first_ULSCH_Tx = 0; } else { ue_get_sdu(Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode); - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -553,8 +538,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, } if (ulsch_harq_information != NULL) fill_ulsch_harq_indication_UE_MAC( - Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, - ul_config_req); + Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, ul_config_req); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) { uint8_t ulsch_buffer[5477] __attribute__((aligned(32))); @@ -564,8 +548,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, uint8_t access_mode = SCHEDULED_ACCESS; if (buflen > 0) { if (UE_mac_inst[Mod_id].first_ULSCH_Tx == 1) { // Msg3 case - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -582,8 +565,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, UE_mac_inst[Mod_id].first_ULSCH_Tx = 0; } else { ue_get_sdu(Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode); - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -605,8 +587,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, uint8_t access_mode = SCHEDULED_ACCESS; if (buflen > 0) { if (UE_mac_inst[Mod_id].first_ULSCH_Tx == 1) { // Msg3 case - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -623,8 +604,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, UE_mac_inst[Mod_id].first_ULSCH_Tx = 0; } else { ue_get_sdu(Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode); - fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, - ul_config_req); + fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti, ul_config_req); fill_rx_indication_UE_MAC(Mod_id, frame, subframe, @@ -638,15 +618,13 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, } if (ulsch_harq_information != NULL) - fill_ulsch_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, - ul_config_req); + fill_ulsch_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, ul_config_req); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_HARQ_PDU_TYPE) { uint16_t rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti; nfapi_ul_config_harq_information *ulsch_harq_information = &ul_config_pdu->uci_harq_pdu.harq_information; if (ulsch_harq_information != NULL) - fill_uci_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, - ul_config_req); + fill_uci_harq_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, ul_config_req); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE) { AssertFatal(1 == 0, "NFAPI_UL_CONFIG_UCI_CQI_PDU_TYPE not handled yet\n"); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_CQI_HARQ_PDU_TYPE) { @@ -660,8 +638,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti; if (ue_get_SR(Mod_id, 0, frame, 0, rnti, subframe)) - fill_sr_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, rnti, - ul_config_req); + fill_sr_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, rnti, ul_config_req); } else if (ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_UCI_SR_HARQ_PDU_TYPE) { // AssertFatal((UE_id = @@ -675,15 +652,13 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, // We fill the sr_indication only if ue_get_sr() would normally instruct PHY // to send a SR. if (ue_get_SR(Mod_id, 0, frame, 0, rnti, subframe)) - fill_sr_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, rnti, - ul_config_req); + fill_sr_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, rnti, ul_config_req); nfapi_ul_config_harq_information *ulsch_harq_information = &ul_config_pdu->uci_sr_harq_pdu.harq_information; if (ulsch_harq_information != NULL) fill_uci_harq_indication_UE_MAC( - Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, - ul_config_req); + Mod_id, frame, subframe, UL_INFO, ulsch_harq_information, rnti, ul_config_req); } } @@ -789,11 +764,11 @@ void dl_config_req_UE_MAC_dci(int sfn, const int pdu_index = dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index; if (pdu_index < 0 || pdu_index >= tx_req_num_elems) { - // LOG_E(MAC, - // "%s(): Problem with receiving data: " - // "sfn/sf:%d.%d PDU size:%d, TX_PDU index: %d\n", - // __func__, - // sfn, sf, dci->pdu_size, dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index); + LOG_E(MAC, + "%s(): Problem with receiving data: " + "sfn/sf:%d.%d PDU size:%d, TX_PDU index: %d\n", + __func__, + sfn, sf, dci->pdu_size, dlsch->dlsch_pdu.dlsch_pdu_rel8.pdu_index); return; } @@ -910,11 +885,11 @@ void dl_config_req_UE_MAC_mch(int sfn, } else { const int pdu_index = mch->mch_pdu.mch_pdu_rel8.pdu_index; if (pdu_index < 0 || pdu_index >= tx_req_num_elems) { - // LOG_E(MAC, - // "%s(): Problem with receiving data: " - // "sfn/sf:%d.%d PDU size:%d, TX_PDU index: %d\n", - // __func__, - // sfn, sf, mch->pdu_size, mch->mch_pdu.mch_pdu_rel8.pdu_index); + LOG_E(MAC, + "%s(): Problem with receiving data: " + "sfn/sf:%d.%d PDU size:%d, TX_PDU index: %d\n", + __func__, + sfn, sf, mch->pdu_size, mch->mch_pdu.mch_pdu_rel8.pdu_index); return; } ue_send_mch_sdu(ue_id, 0, sfn, @@ -945,8 +920,9 @@ void hi_dci0_req_UE_MAC(int sfn, // The following set of memcpy functions should be getting called as callback // functions from pnf_p7_subframe_ind. -int memcpy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) -{ +int memcpy_dl_config_req(L1_rxtx_proc_t *proc, + nfapi_pnf_p7_config_t *pnf_p7, + nfapi_dl_config_request_t *req) { nfapi_dl_config_request_t *p = malloc(sizeof(nfapi_dl_config_request_t)); @@ -1031,8 +1007,9 @@ int memcpy_tx_req(nfapi_pnf_p7_config_t *pnf_p7, nfapi_tx_request_t *req) { return 0; } -int memcpy_hi_dci0_req (L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req) -{ +int memcpy_hi_dci0_req (L1_rxtx_proc_t *proc, + nfapi_pnf_p7_config_t* pnf_p7, + nfapi_hi_dci0_request_t* req) { nfapi_hi_dci0_request_t *p = (nfapi_hi_dci0_request_t *)malloc(sizeof(nfapi_hi_dci0_request_t)); //if(req!=0){ diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0d2457c6a8..147bc955ae 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -261,7 +261,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB, eNB->UL_INFO.subframe = proc->subframe_rx; eNB->UL_INFO.module_id = eNB->Mod_id; eNB->UL_INFO.CC_id = eNB->CC_id; - eNB->if_inst->UL_indication(&eNB->UL_INFO, proc); // Andrew calling eNB maclayer check the UL_INFO structure + eNB->if_inst->UL_indication(&eNB->UL_INFO, proc); AssertFatal((ret= pthread_mutex_unlock(&eNB->UL_INFO_mutex))==0,"error unlocking UL_INFO_mutex, return %d\n",ret); /* this conflict resolution may be totally wrong, to be tested */ /* CONFLICT RESOLUTION: BEGIN */ diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index ae470988be..20d151e53c 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -511,13 +511,18 @@ static void wait_nfapi_init(char *thread_name) { int main ( int argc, char **argv ) { - struct sched_param param = { + struct sched_param param = + { .sched_priority = sched_get_priority_max(SCHED_RR) }; if (sched_setscheduler( 0, SCHED_RR, ¶m ) == -1 ) + { fprintf(stderr,"error setting scheduler ... are you root?\n"); + } else + { fprintf(stderr,"selected rt scheduler\n"); + } int i; int CC_id = 0; diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index d0fdc2298e..3d3943ce68 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -419,10 +419,11 @@ void init_UE_stub_single_thread(int nb_inst, init_UE_single_thread_stub(nb_inst); printf("UE threads created \n"); - //LOG_I(PHY,"Starting multicast link on %s\n",emul_iface); - //if(NFAPI_MODE!=NFAPI_UE_STUB_PNF || NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) // dont need this - //multicast_link_start(ue_stub_rx_handler,0,emul_iface); + if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) { + LOG_I(PHY,"Starting multicast link on %s\n",emul_iface); + multicast_link_start(ue_stub_rx_handler,0,emul_iface); + } } void init_UE_standalone_thread() @@ -443,7 +444,7 @@ void init_UE_stub(int nb_inst, int uecap_xer_in, char *emul_iface) { - int inst; + int inst; LOG_I(PHY,"UE : Calling Layer 2 for initialization\n"); l2_init_ue(eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL, 0,// cba_group_active @@ -1064,33 +1065,6 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) hi_dci0_req->hi_dci0_request_body.number_of_dci, NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), NFAPI_SFNSF2SF(hi_dci0_req->sfn_sf)); } - // if ((dl_config_req != NULL) != (tx_request_pdu_list != NULL)) { - // uint64_t start = clock_usec(); - // uint64_t deadline = start + 10000; - - // for (;;) { - // if (dl_config_req == NULL) { - // dl_config_req = get_queue(&dl_config_req_queue); - // } - // if (tx_request_pdu_list == NULL) { - // tx_request_pdu_list = get_queue(&tx_req_pdu_queue); - // } - // if (dl_config_req && tx_request_pdu_list) { - // uint64_t elapsed = clock_usec() - start; - // if (elapsed > 1000) { - // LOG_E(MAC, "Time difference between dl_config_req & tx_pdu is: %" PRIu64 "usec (%d %d)\n", - // elapsed, num_lone, num_pairs); - // } - // break; - // } - // if (clock_usec() > deadline) { - // LOG_E(MAC, "In behemoth dl_config_req: %p tx_req_pdu_list: %p (%d %d)\n", dl_config_req, - // tx_request_pdu_list, num_lone, num_pairs); - // break; - // } - // } - // } - if ((dl_config_req != NULL) != (tx_request_pdu_list != NULL)) { num_lone++; @@ -1832,6 +1806,11 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) phy_procedures_UE_SL_RX(UE,proc); oai_subframe_ind(timer_frame, timer_subframe); + if(dl_config_req!= NULL) { + AssertFatal(0, "dl_config_req_UE_MAC() not handled\n"); + //dl_config_req_UE_MAC(dl_config_req, Mod_id); + } + //if(UE_mac_inst[Mod_id].hi_dci0_req!= NULL){ if (hi_dci0_req!=NULL && hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL) { AssertFatal(0, "hi_dci0_req_UE_MAC() not handled\n"); diff --git a/targets/RT/USER/lte-uesoftmodem.c b/targets/RT/USER/lte-uesoftmodem.c index 218a337fd5..23f321dd5f 100644 --- a/targets/RT/USER/lte-uesoftmodem.c +++ b/targets/RT/USER/lte-uesoftmodem.c @@ -543,13 +543,18 @@ void init_pdcp(void) { } int main( int argc, char **argv ) { - struct sched_param param = { + struct sched_param param = + { .sched_priority = sched_get_priority_max(SCHED_RR) }; if (sched_setscheduler( 0, SCHED_RR, ¶m ) == -1 ) + { fprintf(stderr,"error setting scheduler ... are you root?\n"); + } else + { fprintf(stderr,"selected rt scheduler\n"); + } int CC_id; uint8_t abstraction_flag=0;