From b6fbb51d7d0512e77bf6eeeaa355659e086acff7 Mon Sep 17 00:00:00 2001 From: Andrew Burger Date: Wed, 24 Jun 2020 15:12:00 -0700 Subject: [PATCH] Additional logging for debugging fill functions --- openair2/PHY_INTERFACE/phy_stub_UE.c | 19 +++++++++++++++++++ targets/RT/USER/lte-ue.c | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/openair2/PHY_INTERFACE/phy_stub_UE.c b/openair2/PHY_INTERFACE/phy_stub_UE.c index 84d9e38745..16e2d469b1 100644 --- a/openair2/PHY_INTERFACE/phy_stub_UE.c +++ b/openair2/PHY_INTERFACE/phy_stub_UE.c @@ -73,8 +73,11 @@ void fill_rx_indication_UE_MAC(module_id_t Mod_id, nfapi_rx_indication_pdu_t *pdu; int timing_advance_update; + LOG_I(MAC, "Entered fill_rx_indication_UE_MAC\n"); + pthread_mutex_lock(&fill_ul_mutex.rx_mutex); + UL_INFO->rx_ind.header.message_id = NFAPI_RX_ULSCH_INDICATION; UL_INFO->rx_ind.sfn_sf = frame << 4 | subframe; UL_INFO->rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; UL_INFO->rx_ind.vendor_extension = ul_config_req->vendor_extension; @@ -121,6 +124,8 @@ 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]; @@ -162,6 +167,8 @@ 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\n"); + 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]; @@ -267,6 +274,8 @@ 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; @@ -306,6 +315,8 @@ 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]; @@ -355,6 +366,8 @@ 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; @@ -1245,20 +1258,26 @@ void *ue_standalone_pnf_task(void *context) break; case NFAPI_CRC_INDICATION: encoded_size = nfapi_p7_message_pack(&UL->crc_ind, buffer, sizeof(buffer), NULL); + LOG_D(MAC, "CRC_IND sent to Proxy\n"); break; case NFAPI_RX_ULSCH_INDICATION: // is this the right nfapi message_id? Ask Raymond encoded_size = nfapi_p7_message_pack(&UL->rx_ind, buffer, sizeof(buffer), NULL); + LOG_D(MAC, "RX_IND sent to Proxy\n"); break; case NFAPI_RX_CQI_INDICATION: // is this the right nfapi message_id? Ask Raymond encoded_size = nfapi_p7_message_pack(&UL->cqi_ind, buffer, sizeof(buffer), NULL); + LOG_D(MAC, "CQI_IND sent to Proxy\n"); break; case NFAPI_HARQ_INDICATION: + LOG_D(MAC, "HARQ_IND sent to Proxy\n"); encoded_size = nfapi_p7_message_pack(&UL->harq_ind, buffer, sizeof(buffer), NULL); break; case NFAPI_RX_SR_INDICATION: // is this the right nfapi message_id? Ask Raymond encoded_size = nfapi_p7_message_pack(&UL->sr_ind, buffer, sizeof(buffer), NULL); + LOG_D(MAC, "SR_IND sent to Proxy\n"); break; default: + LOG_E(MAC, "%s Unknown Message msg_type :: %u\n", __func__, msg_type); return; } if (encoded_size < 0) diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index ae1197e996..9a322b3ff5 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1014,7 +1014,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) UE = rtd->UE; - UL_INFO = (UL_IND_t *)malloc(sizeof(UL_IND_t)); + UL_INFO = (UL_IND_t *)calloc(1, sizeof(UL_IND_t)); UL_INFO->rx_ind.rx_indication_body.rx_pdu_list = calloc(NB_UE_INST, sizeof(nfapi_rx_indication_pdu_t)); UL_INFO->rx_ind.rx_indication_body.number_of_pdus = 0; UL_INFO->crc_ind.crc_indication_body.crc_pdu_list = calloc(NB_UE_INST, sizeof(nfapi_crc_indication_pdu_t)); @@ -1244,6 +1244,7 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg) } if (UL_INFO->rx_ind.rx_indication_body.number_of_pdus > 0) { + //LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/SF:%d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, NFAPI_SFNSF2DEC(UL_info->rx_ind.sfn_sf)); //LOG_I(MAC, "ul_config_req_UE_MAC 2.3, SFN/SF of PNF counter:%d.%d, number_of_pdus: %d \n", timer_frame, timer_subframe, UL_INFO->rx_ind.rx_indication_body.number_of_pdus); send_standalone_msg(UL_INFO, UL_INFO->rx_ind.header.message_id);