From 664170fec6f9012b345573d28f1b29ab8c709052 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 4 Mar 2020 10:49:51 +0100 Subject: [PATCH] pcap: add CC index when writing PCAP --- lib/include/srslte/common/mac_pcap.h | 16 +++-- lib/include/srslte/common/pcap.h | 2 + lib/include/srslte/interfaces/ue_interfaces.h | 2 +- lib/src/common/mac_pcap.cc | 68 ++++++++++++------- lib/src/common/pcap.c | 4 ++ srsenb/hdr/stack/mac/ue.h | 2 + srsenb/src/stack/mac/mac.cc | 8 +-- srsenb/src/stack/mac/ue.cc | 2 +- srsue/hdr/phy/sync.h | 2 + srsue/hdr/stack/mac/mac.h | 2 +- srsue/hdr/stack/mac/proc_ra.h | 2 +- srsue/hdr/stack/ue_stack_lte.h | 2 +- srsue/src/phy/sync.cc | 4 +- srsue/src/stack/mac/dl_harq.cc | 5 +- srsue/src/stack/mac/mac.cc | 10 +-- srsue/src/stack/mac/proc_ra.cc | 4 +- srsue/src/stack/mac/ul_harq.cc | 2 +- srsue/test/phy/ue_phy_test.cc | 2 +- 18 files changed, 84 insertions(+), 55 deletions(-) diff --git a/lib/include/srslte/common/mac_pcap.h b/lib/include/srslte/common/mac_pcap.h index 92a83977b..8a4ba4d5e 100644 --- a/lib/include/srslte/common/mac_pcap.h +++ b/lib/include/srslte/common/mac_pcap.h @@ -38,15 +38,16 @@ public: void set_ue_id(uint16_t ue_id); - void write_ul_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t crnti, uint32_t reTX, uint32_t tti); - void write_dl_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t crnti, bool crc_ok, uint32_t tti); - void write_dl_ranti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t ranti, bool crc_ok, uint32_t tti); + void + write_ul_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t crnti, uint32_t reTX, uint32_t tti, uint8_t cc_idx); + void write_dl_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t crnti, bool crc_ok, uint32_t tti, uint8_t cc_idx); + void write_dl_ranti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t ranti, bool crc_ok, uint32_t tti, uint8_t cc_idx); // SI and BCH only for DL - void write_dl_sirnti(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti); - void write_dl_bch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti); - void write_dl_pch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti); - void write_dl_mch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti); + void write_dl_sirnti(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx); + void write_dl_bch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx); + void write_dl_pch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx); + void write_dl_mch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx); void write_ul_rrc_pdu(const uint8_t* input, const int32_t input_len); @@ -58,6 +59,7 @@ private: uint32_t pdu_len_bytes, uint32_t reTX, bool crc_ok, + uint8_t cc_idx, uint32_t tti, uint16_t crnti_, uint8_t direction, diff --git a/lib/include/srslte/common/pcap.h b/lib/include/srslte/common/pcap.h index 0cac1ae71..ea0e51e34 100644 --- a/lib/include/srslte/common/pcap.h +++ b/lib/include/srslte/common/pcap.h @@ -75,6 +75,7 @@ typedef struct pcaprec_hdr_s { #define MAC_LTE_PREDFINED_DATA_TAG 0x05 #define MAC_LTE_RETX_TAG 0x06 #define MAC_LTE_CRC_STATUS_TAG 0x07 +#define MAC_LTE_CARRIER_ID_TAG 0x0A #define MAC_LTE_NB_MODE_TAG 0x0F /* Context information for every MAC PDU that will be logged */ @@ -86,6 +87,7 @@ typedef struct MAC_Context_Info_t { unsigned short ueid; unsigned char isRetx; unsigned char crcStatusOK; + unsigned char cc_idx; unsigned short sysFrameNumber; unsigned short subFrameNumber; diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 10dbf0de0..198e03905 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -399,7 +399,7 @@ public: virtual void tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSLTE_MAX_CODEWORDS]) = 0; /* Indicate successful decoding of BCH TB through PBCH */ - virtual void bch_decoded_ok(uint8_t* payload, uint32_t len) = 0; + virtual void bch_decoded_ok(uint32_t cc_idx, uint8_t* payload, uint32_t len) = 0; /* Indicate successful decoding of MCH TB through PMCH */ virtual void mch_decoded(uint32_t len, bool crc) = 0; diff --git a/lib/src/common/mac_pcap.cc b/lib/src/common/mac_pcap.cc index 4fa2067a9..fb4a64560 100644 --- a/lib/src/common/mac_pcap.cc +++ b/lib/src/common/mac_pcap.cc @@ -63,56 +63,72 @@ void mac_pcap::pack_and_write(uint8_t* pdu, uint32_t pdu_len_bytes, uint32_t reTX, bool crc_ok, + uint8_t cc_idx, uint32_t tti, uint16_t crnti, uint8_t direction, uint8_t rnti_type) { if (enable_write) { - MAC_Context_Info_t context = { - FDD_RADIO, - direction, - rnti_type, - crnti, /* RNTI */ - (uint16_t)ue_id, /* UEId */ - (uint8_t)reTX, /* Retx */ - crc_ok, /* CRC Stsatus (i.e. OK) */ - (uint16_t)(tti / 10), /* Sysframe number */ - (uint16_t)(tti % 10) /* Subframe number */ - }; + MAC_Context_Info_t context = {}; + context.radioType = FDD_RADIO; + context.direction = direction; + context.rntiType = rnti_type; + context.rnti = crnti; + context.ueid = (uint16_t)ue_id; + context.isRetx = (uint8_t)reTX; + context.crcStatusOK = crc_ok; + context.cc_idx = cc_idx; + context.sysFrameNumber = (uint16_t)(tti / 10); + context.subFrameNumber = (uint16_t)(tti % 10); if (pdu) { LTE_PCAP_MAC_WritePDU(pcap_file, &context, pdu, pdu_len_bytes); } } } -void mac_pcap::write_dl_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t rnti, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_crnti(uint8_t* pdu, + uint32_t pdu_len_bytes, + uint16_t rnti, + bool crc_ok, + uint32_t tti, + uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, rnti, DIRECTION_DOWNLINK, C_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, C_RNTI); } -void mac_pcap::write_dl_ranti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t rnti, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_ranti(uint8_t* pdu, + uint32_t pdu_len_bytes, + uint16_t rnti, + bool crc_ok, + uint32_t tti, + uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, rnti, DIRECTION_DOWNLINK, RA_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, rnti, DIRECTION_DOWNLINK, RA_RNTI); } -void mac_pcap::write_ul_crnti(uint8_t* pdu, uint32_t pdu_len_bytes, uint16_t rnti, uint32_t reTX, uint32_t tti) +void mac_pcap::write_ul_crnti(uint8_t* pdu, + uint32_t pdu_len_bytes, + uint16_t rnti, + uint32_t reTX, + uint32_t tti, + uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, reTX, true, tti, rnti, DIRECTION_UPLINK, C_RNTI); + pack_and_write(pdu, pdu_len_bytes, reTX, true, cc_idx, tti, rnti, DIRECTION_UPLINK, C_RNTI); } -void mac_pcap::write_dl_bch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_bch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, 0, DIRECTION_DOWNLINK, NO_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, 0, DIRECTION_DOWNLINK, NO_RNTI); } -void mac_pcap::write_dl_pch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_pch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, SRSLTE_PRNTI, DIRECTION_DOWNLINK, P_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_PRNTI, DIRECTION_DOWNLINK, P_RNTI); } -void mac_pcap::write_dl_mch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_mch(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, SRSLTE_MRNTI, DIRECTION_DOWNLINK, M_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_MRNTI, DIRECTION_DOWNLINK, M_RNTI); } -void mac_pcap::write_dl_sirnti(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti) +void mac_pcap::write_dl_sirnti(uint8_t* pdu, uint32_t pdu_len_bytes, bool crc_ok, uint32_t tti, uint8_t cc_idx) { - pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, tti, SRSLTE_SIRNTI, DIRECTION_DOWNLINK, SI_RNTI); + pack_and_write(pdu, pdu_len_bytes, 0, crc_ok, cc_idx, tti, SRSLTE_SIRNTI, DIRECTION_DOWNLINK, SI_RNTI); } void mac_pcap::write_ul_rrc_pdu(const uint8_t* input, const int32_t input_len) @@ -185,6 +201,6 @@ void mac_pcap::write_ul_rrc_pdu(const uint8_t* input, const int32_t input_len) memcpy(pdu_ptr, &pad, 1); pdu_ptr += 1; - write_ul_crnti(pdu, pdu_ptr - pdu, 14931, true, 0); + write_ul_crnti(pdu, pdu_ptr - pdu, 14931, true, 0, 0); } } // namespace srslte diff --git a/lib/src/common/pcap.c b/lib/src/common/pcap.c index 209e40343..4bf552506 100644 --- a/lib/src/common/pcap.c +++ b/lib/src/common/pcap.c @@ -102,6 +102,10 @@ int LTE_PCAP_MAC_WritePDU(FILE* fd, MAC_Context_Info_t* context, const unsigned context_header[offset++] = MAC_LTE_CRC_STATUS_TAG; context_header[offset++] = context->crcStatusOK; + /* CC index */ + context_header[offset++] = MAC_LTE_CARRIER_ID_TAG; + context_header[offset++] = context->cc_idx; + /* NB-IoT mode tag */ context_header[offset++] = MAC_LTE_NB_MODE_TAG; context_header[offset++] = context->nbiotMode; diff --git a/srsenb/hdr/stack/mac/ue.h b/srsenb/hdr/stack/mac/ue.h index b6d61d3aa..89ec74492 100644 --- a/srsenb/hdr/stack/mac/ue.h +++ b/srsenb/hdr/stack/mac/ue.h @@ -143,6 +143,8 @@ private: // Mutexes pthread_mutex_t mutex; + + const uint8_t UL_CC_IDX = 0; ///< Passed to write CC index in PCAP (TODO: use actual CC idx) }; } // namespace srsenb diff --git a/srsenb/src/stack/mac/mac.cc b/srsenb/src/stack/mac/mac.cc index db86f6e50..b9fa8aba3 100644 --- a/srsenb/src/stack/mac/mac.cc +++ b/srsenb/src/stack/mac/mac.cc @@ -524,7 +524,7 @@ int mac::get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res_list) } if (pcap) { - pcap->write_dl_crnti(dl_sched_res->pdsch[n].data[tb], sched_result.data[i].tbs[tb], rnti, true, tti); + pcap->write_dl_crnti(dl_sched_res->pdsch[n].data[tb], sched_result.data[i].tbs[tb], rnti, true, tti, 0); } } else { @@ -555,7 +555,7 @@ int mac::get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res_list) if (pcap) { pcap->write_dl_ranti( - dl_sched_res->pdsch[n].data[0], sched_result.rar[i].tbs, dl_sched_res->pdsch[n].dci.rnti, true, tti); + dl_sched_res->pdsch[n].data[0], sched_result.rar[i].tbs, dl_sched_res->pdsch[n].dci.rnti, true, tti, 0); } n++; @@ -572,7 +572,7 @@ int mac::get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res_list) dl_sched_res->pdsch[n].data[0] = assemble_si(sched_result.bc[i].index); #ifdef WRITE_SIB_PCAP if (pcap) { - pcap->write_dl_sirnti(dl_sched_res->pdsch[n].data[0], sched_result.bc[i].tbs, true, tti); + pcap->write_dl_sirnti(dl_sched_res->pdsch[n].data[0], sched_result.bc[i].tbs, true, tti, 0); } #endif } else { @@ -581,7 +581,7 @@ int mac::get_dl_sched(uint32_t tti, dl_sched_list_t& dl_sched_res_list) rlc_h->read_pdu_pcch(pcch_payload_buffer, pcch_payload_buffer_len); if (pcap) { - pcap->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.bc[i].tbs, true, tti); + pcap->write_dl_pch(dl_sched_res->pdsch[n].data[0], sched_result.bc[i].tbs, true, tti, 0); } } diff --git a/srsenb/src/stack/mac/ue.cc b/srsenb/src/stack/mac/ue.cc index 0ae7396e9..602f0bd33 100644 --- a/srsenb/src/stack/mac/ue.cc +++ b/srsenb/src/stack/mac/ue.cc @@ -189,7 +189,7 @@ void ue::process_pdu(uint8_t* pdu, uint32_t nof_bytes, srslte::pdu_queue::channe mac_msg_ul.parse_packet(pdu); if (pcap) { - pcap->write_ul_crnti(pdu, nof_bytes, rnti, true, last_tti); + pcap->write_ul_crnti(pdu, nof_bytes, rnti, true, last_tti, UL_CC_IDX); } pdus.deallocate(pdu); diff --git a/srsue/hdr/phy/sync.h b/srsue/hdr/phy/sync.h index a2d97a9be..89226991b 100644 --- a/srsue/hdr/phy/sync.h +++ b/srsue/hdr/phy/sync.h @@ -359,6 +359,8 @@ private: float dl_freq = -1; float ul_freq = -1; + + const uint8_t SYNC_CC_IDX = 0; ///< From the sync POV, the CC idx is always the first }; } // namespace srsue diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index 74b987252..5d17f78e5 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -65,7 +65,7 @@ public: void new_grant_dl(uint32_t cc_idx, mac_grant_dl_t grant, tb_action_dl_t* action); void new_mch_dl(srslte_pdsch_grant_t phy_grant, tb_action_dl_t* action); void tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSLTE_MAX_CODEWORDS]); - void bch_decoded_ok(uint8_t* payload, uint32_t len); + void bch_decoded_ok(uint32_t cc_idx, uint8_t* payload, uint32_t len); uint16_t get_dl_sched_rnti(uint32_t tti); uint16_t get_ul_sched_rnti(uint32_t tti); diff --git a/srsue/hdr/stack/mac/proc_ra.h b/srsue/hdr/stack/mac/proc_ra.h index f3b85d5ed..17f7444c8 100644 --- a/srsue/hdr/stack/mac/proc_ra.h +++ b/srsue/hdr/stack/mac/proc_ra.h @@ -90,7 +90,7 @@ public: void pdcch_to_crnti(bool is_new_uplink_transmission); void timer_expired(uint32_t timer_id); void new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_interface_phy_lte::tb_action_dl_t* action); - void tb_decoded_ok(const uint32_t tti); + void tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti); void start_noncont(uint32_t preamble_index, uint32_t prach_mask); bool contention_resolution_id_received(uint64_t uecri); diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index 7dbc4bcce..0f9dc704a 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -99,7 +99,7 @@ public: mac.tb_decoded(cc_idx, grant, ack); } - void bch_decoded_ok(uint8_t* payload, uint32_t len) { mac.bch_decoded_ok(payload, len); } + void bch_decoded_ok(uint32_t cc_idx, uint8_t* payload, uint32_t len) { mac.bch_decoded_ok(cc_idx, payload, len); } void mch_decoded(uint32_t len, bool crc) { mac.mch_decoded(len, crc); } diff --git a/srsue/src/phy/sync.cc b/srsue/src/phy/sync.cc index 2bb725b98..375af3dab 100644 --- a/srsue/src/phy/sync.cc +++ b/srsue/src/phy/sync.cc @@ -386,7 +386,7 @@ void sync::run_thread() return; } for (uint32_t i = 0; i < nof_rf_channels; i++) { - dummy_buffer[i] = (cf_t*)srslte_vec_cf_malloc(3 * SRSLTE_SF_LEN_PRB(100)); + dummy_buffer[i] = srslte_vec_cf_malloc(3 * SRSLTE_SF_LEN_PRB(100)); } uint32_t prach_nof_sf = 0; @@ -413,7 +413,7 @@ void sync::run_thread() */ cell_search_ret = search_p.run(&cell, mib); if (cell_search_ret == search::CELL_FOUND) { - stack->bch_decoded_ok(mib.data(), mib.size() / 8); + stack->bch_decoded_ok(SYNC_CC_IDX, mib.data(), mib.size() / 8); } phy_state.state_exit(); break; diff --git a/srsue/src/stack/mac/dl_harq.cc b/srsue/src/stack/mac/dl_harq.cc index ba9cc8143..f6b315ecb 100644 --- a/srsue/src/stack/mac/dl_harq.cc +++ b/srsue/src/stack/mac/dl_harq.cc @@ -327,14 +327,15 @@ void dl_harq_entity::dl_harq_process::dl_tb_process::tb_decoded(mac_interface_ph if (ack) { if (is_bcch) { if (harq_entity->pcap) { - harq_entity->pcap->write_dl_sirnti(payload_buffer_ptr, cur_grant.tb[tid].tbs, ack, cur_grant.tti); + harq_entity->pcap->write_dl_sirnti( + payload_buffer_ptr, cur_grant.tb[tid].tbs, ack, cur_grant.tti, harq_entity->cc_idx); } Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.tb[tid].tbs); harq_entity->demux_unit->push_pdu_bcch(payload_buffer_ptr, cur_grant.tb[tid].tbs); } else { if (harq_entity->pcap) { harq_entity->pcap->write_dl_crnti( - payload_buffer_ptr, cur_grant.tb[tid].tbs, cur_grant.rnti, ack, cur_grant.tti); + payload_buffer_ptr, cur_grant.tb[tid].tbs, cur_grant.rnti, ack, cur_grant.tti, harq_entity->cc_idx); } if (cur_grant.rnti == harq_entity->rntis->temp_rnti) { Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.tb[tid].tbs); diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index 0091784be..2d112fcdb 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -357,13 +357,13 @@ uint16_t mac::get_dl_sched_rnti(uint32_t tti) return SRSLTE_INVALID_RNTI; } -void mac::bch_decoded_ok(uint8_t* payload, uint32_t len) +void mac::bch_decoded_ok(uint32_t cc_idx, uint8_t* payload, uint32_t len) { // Send MIB to RLC rlc_h->write_pdu_bcch_bch(payload, len); if (pcap) { - pcap->write_dl_bch(payload, len, true, phy_h->get_current_tti()); + pcap->write_dl_bch(payload, len, true, phy_h->get_current_tti(), cc_idx); } } @@ -389,7 +389,7 @@ void mac::mch_decoded(uint32_t len, bool crc) demux_unit.push_pdu_mch(mch_payload_buffer, len); stack_h->process_pdus(); if (pcap) { - pcap->write_dl_mch(mch_payload_buffer, len, true, phy_h->get_current_tti()); + pcap->write_dl_mch(mch_payload_buffer, len, true, phy_h->get_current_tti(), 0); } metrics[0].rx_brate += len * 8; } else { @@ -402,14 +402,14 @@ void mac::tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSLTE_MAX_ { if (SRSLTE_RNTI_ISRAR(grant.rnti)) { if (ack[0]) { - ra_procedure.tb_decoded_ok(grant.tti); + ra_procedure.tb_decoded_ok(cc_idx, grant.tti); } } else if (grant.rnti == SRSLTE_PRNTI) { // Send PCH payload to RLC rlc_h->write_pdu_pcch(pch_payload_buffer, grant.tb[0].tbs); if (pcap) { - pcap->write_dl_pch(pch_payload_buffer, grant.tb[0].tbs, true, grant.tti); + pcap->write_dl_pch(pch_payload_buffer, grant.tb[0].tbs, true, grant.tti, cc_idx); } } else { diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index 95716d9bf..fd04e79b2 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -401,10 +401,10 @@ void ra_proc::new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_inte /* Called upon the successful decoding of a TB addressed to RA-RNTI. * Processes the reception of a RAR as defined in 5.1.4 */ -void ra_proc::tb_decoded_ok(const uint32_t tti) +void ra_proc::tb_decoded_ok(const uint8_t cc_idx, const uint32_t tti) { if (pcap) { - pcap->write_dl_ranti(rar_pdu_buffer, rar_grant_nbytes, ra_rnti, true, tti); + pcap->write_dl_ranti(rar_pdu_buffer, rar_grant_nbytes, ra_rnti, true, tti, cc_idx); } rDebug("RAR decoded successfully TBS=%d\n", rar_grant_nbytes); diff --git a/srsue/src/stack/mac/ul_harq.cc b/srsue/src/stack/mac/ul_harq.cc index 9272377c2..f9a0ddd46 100644 --- a/srsue/src/stack/mac/ul_harq.cc +++ b/srsue/src/stack/mac/ul_harq.cc @@ -276,7 +276,7 @@ void ul_harq_entity::ul_harq_process::new_grant_ul(mac_interface_phy_lte::mac_gr } else { rnti = harq_entity->rntis->crnti; } - harq_entity->pcap->write_ul_crnti(pdu_ptr, grant.tb.tbs, rnti, get_nof_retx(), grant.tti_tx); + harq_entity->pcap->write_ul_crnti(pdu_ptr, grant.tb.tbs, rnti, get_nof_retx(), grant.tti_tx, harq_entity->cc_idx); } } else if (has_grant()) { // Non-Adaptive Re-Tx diff --git a/srsue/test/phy/ue_phy_test.cc b/srsue/test/phy/ue_phy_test.cc index f868383dd..b7255f0a1 100644 --- a/srsue/test/phy/ue_phy_test.cc +++ b/srsue/test/phy/ue_phy_test.cc @@ -104,7 +104,7 @@ private: } } void tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool* ack) override {} - void bch_decoded_ok(uint8_t* payload, uint32_t len) override {} + void bch_decoded_ok(uint32_t cc_idx, uint8_t* payload, uint32_t len) override {} void mch_decoded(uint32_t len, bool crc) override {} void new_mch_dl(srslte_pdsch_grant_t phy_grant, tb_action_dl_t* action) override {} void set_mbsfn_config(uint32_t nof_mbsfn_services) override {}