Commit 6af674be authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/harqid-in-wireshark-traces' into integration_2024_w32

parents d47eb536 0e7e66ec
......@@ -276,8 +276,21 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ENCODING, VCD_FUNCTION_IN);
uint32_t A = rel15->TBSize[0]<<3;
unsigned char *a=harq->pdu;
if (rel15->rnti != SI_RNTI)
trace_NRpdu(DIRECTION_DOWNLINK, a, rel15->TBSize[0], WS_C_RNTI, rel15->rnti, frame, slot,0, 0);
if (rel15->rnti != SI_RNTI) {
ws_trace_t tmp = {.nr = true,
.direction = DIRECTION_DOWNLINK,
.pdu_buffer = a,
.pdu_buffer_size = rel15->TBSize[0],
.ueid = 0,
.rntiType = WS_C_RNTI,
.rnti = rel15->rnti,
.sysFrame = frame,
.subframe = slot,
.harq_pid = 0, // difficult to find the harq pid here
.oob_event = 0,
.oob_event_value = 0};
trace_pdu(&tmp);
}
NR_gNB_PHY_STATS_t *phy_stats = NULL;
if (rel15->rnti != 0xFFFF)
......
......@@ -183,8 +183,19 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
unav_res,
mod_order,
Nl);
trace_NRpdu(DIRECTION_UPLINK, harq_process_ul_ue->payload_AB, tb_size, WS_C_RNTI, rnti, frame, slot, 0, 0);
ws_trace_t tmp = {.nr = true,
.direction = DIRECTION_UPLINK,
.pdu_buffer = harq_process_ul_ue->payload_AB,
.pdu_buffer_size = tb_size,
.ueid = 0,
.rntiType = WS_C_RNTI,
.rnti = rnti,
.sysFrame = frame,
.subframe = slot,
.harq_pid = harq_pid,
.oob_event = 0,
.oob_event_value = 0};
trace_pdu(&tmp);
if (nr_ulsch_encoding(UE, ulsch_ue, frame_parms, harq_pid, tb_size, G) == -1)
return;
......
......@@ -146,7 +146,17 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
t = WS_RA_RNTI;
if (pdu_type == FAPI_NR_RX_PDU_TYPE_SIB)
t = WS_SI_RNTI;
trace_NRpdu(DIRECTION_DOWNLINK, b, rx->pdsch_pdu.pdu_length, t, dlsch0->rnti, proc->frame_rx, proc->nr_slot_rx, 0, 0);
ws_trace_t tmp = {.nr = true,
.direction = DIRECTION_DOWNLINK,
.pdu_buffer = b,
.pdu_buffer_size = rx->pdsch_pdu.pdu_length,
.ueid = 0,
.rntiType = t,
.rnti = dlsch0->rnti,
.sysFrame = proc->frame_rx,
.subframe = proc->nr_slot_rx,
.harq_pid = dlsch0->dlsch_config.harq_process_nbr};
trace_pdu(&tmp);
}
}
if(dlsch1) {
......
......@@ -2336,8 +2336,15 @@ if((ue->frame_parms.FeMBMS_active == 0)|| is_fembms_cas_subframe(frame_rx,subfra
dummy[0] = ue->pbch_vars[eNB_id]->decoded_output[2];
dummy[1] = ue->pbch_vars[eNB_id]->decoded_output[1];
dummy[2] = ue->pbch_vars[eNB_id]->decoded_output[0];
trace_pdu( DIRECTION_DOWNLINK, dummy, WS_C_RNTI, ue->Mod_id, 0, 0,
frame_rx, subframe_rx, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = dummy,
.pdu_buffer_size = sizeof(dummy),
.ueid = ue->Mod_id,
.rntiType = WS_C_RNTI,
.rnti = ue->Mod_id,
.sysFrame = frame_rx,
.subframe = subframe_rx};
trace_pdu(&tmp);
}
if (pbch_tx_ant>2) {
......
......@@ -893,10 +893,15 @@ generate_Msg4(module_id_t module_idP,
ul_req_body->number_of_pdus++;
T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (ra->rnti), T_INT (frameP), T_INT (subframeP),
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&mac->UE_info.DLSCH_pdu[CC_idP][0][UE_id].payload[0], ra->msg4_TBsize));
trace_pdu (DIRECTION_DOWNLINK, (uint8_t *) mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0],
ra->msg4_rrc_sdu_length,
UE_id, 3, UE_RNTI (module_idP, UE_id),
mac->frame, mac->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
.pdu_buffer_size = ra->msg4_rrc_sdu_length,
.ueid = UE_id,
.rntiType = 3,
.rnti = UE_RNTI(module_idP, UE_id),
.sysFrame = mac->frame,
.subframe = mac->subframe};
trace_pdu(&tmp);
} // Msg4 frame/subframe
} // rach_resource_type > 0
else {
......@@ -1074,12 +1079,15 @@ generate_Msg4(module_id_t module_idP,
T_INT(subframeP), T_INT(0 /*harq_pid always 0? */ ),
T_BUFFER(&mac->UE_info.DLSCH_pdu[CC_idP][0][UE_id].
payload[0], ra->msg4_TBsize));
trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *) mac->
UE_info.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, WS_C_RNTI,
UE_RNTI(module_idP, UE_id), mac->frame,
mac->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = mac->UE_info.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0],
.pdu_buffer_size = rrc_sdu_length,
.ueid = UE_id,
.rntiType = WS_C_RNTI,
.rnti = UE_RNTI(module_idP, UE_id),
.sysFrame = mac->frame,
.subframe = mac->subframe};
trace_pdu(&tmp);
if(RC.mac[module_idP]->scheduler_mode == SCHED_MODE_FAIR_RR) {
set_dl_ue_select_msg4(CC_idP, 4, UE_id, ra->rnti);
......
......@@ -274,10 +274,15 @@ schedule_SIB1_MBMS(module_id_t module_idP,
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_BR_pdu[0].payload[0],
bcch_sdu_length,
0xffff, WS_SI_RNTI, 0xffff, eNB->frame, eNB->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = cc->BCCH_BR_pdu[0].payload,
.pdu_buffer_size = bcch_sdu_length,
.ueid = 0xffff,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
if (cc->tdd_Config != NULL) { //TDD
LOG_D(MAC,
......@@ -498,10 +503,15 @@ schedule_SIB1_BR(module_id_t module_idP,
eNB->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
eNB->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_BR_pdu[0].payload[0],
bcch_sdu_length,
0xffff, WS_SI_RNTI, 0xffff, eNB->frame, eNB->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = cc->BCCH_BR_pdu[0].payload,
.pdu_buffer_size = bcch_sdu_length,
.ueid = 0xffff,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
if (cc->tdd_Config != NULL) { //TDD
LOG_D(MAC,
......@@ -679,13 +689,15 @@ schedule_SI_BR(module_id_t module_idP, frame_t frameP,
TX_req->segments[0].segment_length = bcch_sdu_length;
TX_req->segments[0].segment_data = cc->BCCH_BR_pdu[i+1].payload;
eNB->TX_req[CC_id].tx_request_body.number_of_pdus++;
trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_BR_pdu[i + 1].payload[0],
bcch_sdu_length,
0xffff,
WS_SI_RNTI,
0xffff, eNB->frame, eNB->subframe, 0,
0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = cc->BCCH_BR_pdu[i + 1].payload,
.pdu_buffer_size = bcch_sdu_length,
.ueid = 0xffff,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
if (cc->tdd_Config != NULL) { //TDD
LOG_D(MAC, "[eNB] Frame %d : Scheduling BCCH-BR %d->DLSCH (TDD) for CC_id %d SI-BR %d bytes\n",
......@@ -880,11 +892,15 @@ schedule_SI_MBMS(module_id_t module_idP, frame_t frameP,
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(0xffff),
T_INT(frameP), T_INT(subframeP), T_INT(0), T_BUFFER(cc->BCCH_MBMS_pdu.payload, bcch_sdu_length));
trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_MBMS_pdu.payload[0],
bcch_sdu_length,
0xffff,
WS_SI_RNTI, 0xffff, eNB->frame, eNB->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = cc->BCCH_MBMS_pdu.payload,
.pdu_buffer_size = bcch_sdu_length,
.ueid = 0xffff,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
if (0/*cc->tdd_Config != NULL*/) { //TDD not for FeMBMS
LOG_D(MAC,
......@@ -1207,11 +1223,15 @@ schedule_SI(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(0xffff),
T_INT(frameP), T_INT(subframeP), T_INT(0), T_BUFFER(cc->BCCH_pdu.payload, bcch_sdu_length));
trace_pdu(DIRECTION_DOWNLINK,
&cc->BCCH_pdu.payload[0],
bcch_sdu_length,
0xffff,
WS_SI_RNTI, 0xffff, eNB->frame, eNB->subframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = cc->BCCH_pdu.payload,
.pdu_buffer_size = bcch_sdu_length,
.ueid = 0xffff,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
if (cc->tdd_Config != NULL) { //TDD
LOG_D(MAC,
......
......@@ -983,18 +983,16 @@ schedule_ue_spec(module_id_t module_idP,
for (int j = 0; j < TBS - sdu_length_total - offset; j++) {
dlsch_pdu->payload[0][offset + sdu_length_total + j] = 0;
}
trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *) dlsch_pdu->payload[0],
TBS,
module_idP,
WS_C_RNTI,
UE_RNTI(module_idP,
UE_id),
eNB->frame,
eNB->subframe,
0,
0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = (uint8_t *)dlsch_pdu->payload,
.pdu_buffer_size = TBS,
.ueid = module_idP,
.rntiType = WS_C_RNTI,
.rnti = UE_RNTI(module_idP, UE_id),
.sysFrame = eNB->frame,
.subframe = eNB->subframe,
.harq_pid = harq_pid};
trace_pdu(&tmp);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA,
T_INT(module_idP),
T_INT(CC_id),
......@@ -1648,16 +1646,16 @@ schedule_ue_spec_br(module_id_t module_idP,
UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = (char)(taus()&0xff);
}
trace_pdu(DIRECTION_DOWNLINK,
(uint8_t *)UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0],
TBS,
module_idP,
3,
UE_RNTI(module_idP,UE_id),
mac->frame,
mac->subframe,
0,
0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0],
.pdu_buffer_size = TBS,
.ueid = module_idP,
.rntiType = 3,
.rnti = UE_RNTI(module_idP, UE_id),
.sysFrame = mac->frame,
.subframe = mac->subframe,
.harq_pid = harq_pid};
trace_pdu(&tmp);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA,
T_INT(module_idP),
T_INT(CC_id),
......@@ -1850,16 +1848,15 @@ schedule_ue_spec_br(module_id_t module_idP,
T_INT (subframeP),
T_INT (0 /* harq_pid always 0? */ ),
T_BUFFER (&mac->UE_info.DLSCH_pdu[CC_id][0][UE_id].payload[0], TX_req->pdu_length));
trace_pdu(1,
(uint8_t *) mac->UE_info.DLSCH_pdu[CC_id][0][(unsigned char) UE_id].payload[0],
TX_req->pdu_length,
UE_id,
3,
rnti,
frameP,
subframeP,
0,
0);
ws_trace_t tmp = {.direction = 1,
.pdu_buffer = mac->UE_info.DLSCH_pdu[CC_id][0][UE_id].payload[0],
.pdu_buffer_size = TX_req->pdu_length,
.ueid = UE_id,
.rntiType = 3,
.rnti = rnti,
.sysFrame = frameP,
.subframe = subframeP};
trace_pdu(&tmp);
} // end else if ((subframeP == 7) && (round_DL < 8))
} // end loop on UE_id
}
......@@ -2360,17 +2357,15 @@ schedule_PCH(module_id_t module_idP,
subframeP);
continue;
}
trace_pdu(DIRECTION_DOWNLINK,
&eNB->common_channels[CC_id].PCCH_pdu.payload[0],
pcch_sdu_length,
0xffff,
PCCH,
P_RNTI,
eNB->frame,
eNB->subframe,
0,
0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = eNB->common_channels[CC_id].PCCH_pdu.payload,
.pdu_buffer_size = pcch_sdu_length,
.ueid = 0xffff,
.rntiType = PCCH,
.rnti = P_RNTI,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
eNB->eNB_stats[CC_id].total_num_pcch_pdu++;
eNB->eNB_stats[CC_id].pcch_buffer = pcch_sdu_length;
eNB->eNB_stats[CC_id].total_pcch_buffer += pcch_sdu_length;
......
......@@ -1910,10 +1910,16 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
for (j=0; j<(TBS-sdu_length_total-offset); j++) {
UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset+sdu_length_total+j] = (char)(taus()&0xff);
}
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *)UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0],
TBS, module_idP, WS_C_RNTI, UE_RNTI(module_idP, UE_id),
eNB->frame, eNB->subframe,0,0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0],
.pdu_buffer_size = TBS,
.ueid = module_idP,
.rntiType = WS_C_RNTI,
.rnti = UE_RNTI(module_idP, UE_id),
.sysFrame = eNB->frame,
.subframe = eNB->subframe,
.harq_pid = harq_pid};
trace_pdu(&tmp);
T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_BUFFER(UE_info->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS));
UE_info->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
......
......@@ -1055,16 +1055,22 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
/* Tracing of PDU is done on UE side */
//if (opt_enabled == 1) {
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) cc->MCH_pdu.payload, TBS, module_idP, WS_M_RNTI , 0xfffd, // M_RNTI = 6 in wirehsark
RC.mac[module_idP]->frame,
RC.mac[module_idP]->subframe, 0, 0);
LOG_D(OPT, "[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n",
module_idP, CC_id, frameP, TBS);
//}
eNB_MAC_INST *eNB = RC.mac[module_idP];
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = (uint8_t *)cc->MCH_pdu.payload,
.pdu_buffer_size = TBS,
.ueid = module_idP,
.rntiType = WS_M_RNTI,
.rnti = 0xfffd, // M_RNTI = 6 in wireshark
.sysFrame = RC.mac[module_idP]->frame,
.subframe = RC.mac[module_idP]->subframe};
trace_pdu(&tmp);
LOG_D(OPT, "[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n", module_idP, CC_id, frameP, TBS);
//}
eNB_MAC_INST *eNB = RC.mac[module_idP];
dl_req = &eNB->DL_req[CC_id].dl_config_request_body;
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
fill_nfapi_mch_config(
dl_req,
TBS,
......@@ -1830,19 +1836,23 @@ schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
/* Tracing of PDU is done on UE side */
//if (opt_enabled == 1) {
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) cc->MCH_pdu.payload, TBS, module_idP, WS_M_RNTI , 0xffff, // M_RNTI = 6 in wirehsark
RC.mac[module_idP]->frame,
RC.mac[module_idP]->subframe, 0, 0);
LOG_D(OPT,
"[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n",
module_idP, CC_id, frameP, TBS);
//}
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",RC.mac[module_idP]->MCH_pdu.payload[j+offset]);
printf(" \n"); */
return 1;
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = (uint8_t *)cc->MCH_pdu.payload,
.pdu_buffer_size = TBS,
.ueid = module_idP,
.rntiType = WS_M_RNTI,
.rnti = 0xffff, // M_RNTI = 6 in wireshark
.sysFrame = RC.mac[module_idP]->frame,
.subframe = RC.mac[module_idP]->subframe};
trace_pdu(&tmp);
LOG_D(OPT, "[eNB %d][MCH] CC_id %d Frame %d : MAC PDU with size %d\n", module_idP, CC_id, frameP, TBS);
//}
/*
for (j=0;j<sdu_length_total;j++)
printf("%2x.",RC.mac[module_idP]->MCH_pdu.payload[j+offset]);
printf(" \n"); */
return 1;
} else {
cc->MCH_pdu.Pdu_size = 0;
cc->MCH_pdu.sync_area = 0;
......
......@@ -134,7 +134,15 @@ rx_sdu(const module_id_t enb_mod_idP,
memset(rx_lengths, 0, NB_RB_MAX * sizeof(unsigned short));
start_meas(&mac->rx_ulsch_sdu);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU, 1);
trace_pdu(DIRECTION_UPLINK, sduP, sdu_lenP, 0, WS_C_RNTI, current_rnti, frameP, subframeP, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = sduP,
.pdu_buffer_size = sdu_lenP,
.ueid = 0,
.rntiType = WS_C_RNTI,
.rnti = current_rnti,
.sysFrame = frameP,
.subframe = subframeP};
trace_pdu(&tmp);
if (UE_id != -1) {
UE_scheduling_control = &UE_info->UE_sched_ctrl[UE_id];
......
......@@ -253,11 +253,17 @@ Msg1_transmitted(module_id_t module_idP, uint8_t CC_id,
"Transmission on secondary CCs is not supported yet\n");
// start contention resolution timer
UE_mac_inst[module_idP].RA_attempt_number++;
trace_pdu(DIRECTION_UPLINK, NULL, 0, module_idP, WS_NO_RNTI,
UE_mac_inst[module_idP].RA_prach_resources.
ra_PreambleIndex, UE_mac_inst[module_idP].txFrame,
UE_mac_inst[module_idP].txSubframe, 0,
UE_mac_inst[module_idP].RA_attempt_number);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = NULL,
.pdu_buffer_size = 0,
.ueid = module_idP,
.rntiType = WS_NO_RNTI,
.rnti = UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex,
.sysFrame = UE_mac_inst[module_idP].txFrame,
.subframe = UE_mac_inst[module_idP].txSubframe,
.oob_event = 0,
.oob_event_value = UE_mac_inst[module_idP].RA_attempt_number};
trace_pdu(&tmp);
}
......@@ -272,11 +278,15 @@ Msg3_transmitted(module_id_t module_idP, uint8_t CC_id,
module_idP, frameP);
UE_mac_inst[module_idP].RA_contention_resolution_cnt = 0;
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 1;
trace_pdu(DIRECTION_UPLINK, &UE_mac_inst[module_idP].CCCH_pdu.payload[0],
UE_mac_inst[module_idP].RA_Msg3_size, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti,
UE_mac_inst[module_idP].txFrame,
UE_mac_inst[module_idP].txSubframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = UE_mac_inst[module_idP].CCCH_pdu.payload,
.pdu_buffer_size = UE_mac_inst[module_idP].RA_Msg3_size,
.ueid = module_idP,
.rntiType = WS_C_RNTI,
.rnti = UE_mac_inst[module_idP].crnti,
.sysFrame = UE_mac_inst[module_idP].txFrame,
.subframe = UE_mac_inst[module_idP].txSubframe};
trace_pdu(&tmp);
}
......
......@@ -93,9 +93,15 @@ fill_rar(const module_id_t module_idP,
rar[3] =
(((ra->msg3_mcs & 0x7) << 5)) | ((ra->msg3_TPC & 7) << 2) |
((ra->msg3_ULdelay & 1) << 1) | (ra->msg3_cqireq & 1);
trace_pdu(DIRECTION_DOWNLINK, dlsch_buffer, input_buffer_length, module_idP, WS_RA_RNTI, 1,
RC.mac[module_idP]->frame, RC.mac[module_idP]->subframe,
0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = dlsch_buffer,
.pdu_buffer_size = input_buffer_length,
.ueid = module_idP,
.rntiType = WS_RA_RNTI,
.rnti = 1,
.sysFrame = RC.mac[module_idP]->frame,
.subframe = RC.mac[module_idP]->subframe};
trace_pdu(&tmp);
return (ra->rnti);
}
......@@ -186,17 +192,15 @@ unsigned short fill_rar_br(eNB_MAC_INST *eNB,
rarh->RAPID,
ra->preamble_index,
ra->timing_offset);
trace_pdu(DIRECTION_DOWNLINK,
dlsch_buffer,
input_buffer_length,
eNB->Mod_id,
WS_RA_RNTI,
1,
eNB->frame,
eNB->subframe,
0,
0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = dlsch_buffer,
.pdu_buffer_size = input_buffer_length,
.ueid = eNB->Mod_id,
.rntiType = WS_RA_RNTI,
.rnti = 1,
.sysFrame = eNB->frame,
.subframe = eNB->subframe};
trace_pdu(&tmp);
return (ra->rnti);
}
......@@ -115,9 +115,15 @@ uint16_t ue_process_rar(const module_id_t module_idP, const int CC_id, const fra
LOG_D(MAC, "[UE %d][RAPROC] rar->t_crnti %x\n", module_idP,
(uint16_t) rar[5] + (rar[4] << 8));
#endif
trace_pdu(DIRECTION_DOWNLINK, (uint8_t *) dlsch_buffer, n_rarh + n_rarpy * 6,
module_idP, WS_RA_RNTI, ra_rnti, UE_mac_inst[module_idP].rxFrame,
UE_mac_inst[module_idP].rxSubframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = dlsch_buffer,
.pdu_buffer_size = n_rarh + n_rarpy * 6,
.ueid = module_idP,
.rntiType = WS_RA_RNTI,
.rnti = ra_rnti,
.sysFrame = UE_mac_inst[module_idP].rxFrame,
.subframe = UE_mac_inst[module_idP].rxSubframe};
trace_pdu(&tmp);
if (preamble_index == rarh->RAPID) {
*t_crnti = (uint16_t) rar[5] + (rar[4] << 8); //rar->t_crnti;
......
......@@ -378,8 +378,15 @@ ue_send_sdu(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN);
//LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]);
trace_pdu(DIRECTION_DOWNLINK, sdu, sdu_len, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti, frameP, subframeP, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_DOWNLINK,
.pdu_buffer = sdu,
.pdu_buffer_size = sdu_len,
.ueid = module_idP,
.rntiType = WS_C_RNTI,
.rnti = UE_mac_inst[module_idP].crnti,
.sysFrame = frameP,
.subframe = subframeP};
trace_pdu(&tmp);
payload_ptr =
parse_header(sdu, &num_ce, &num_sdu, rx_ces, rx_lcids, rx_lengths,
sdu_len);
......@@ -576,16 +583,15 @@ void ue_decode_si_mbms(module_id_t module_idP, int CC_id, frame_t frameP,
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
stop_UE_TIMING(UE_mac_inst[module_idP].rx_si);
trace_pdu(DIRECTION_UPLINK,
(uint8_t *) pdu,
len,
module_idP,
WS_SI_RNTI,
0xffff,
UE_mac_inst[module_idP].rxFrame,
UE_mac_inst[module_idP].rxSubframe,
0,
0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = pdu,
.pdu_buffer_size = len,
.ueid = module_idP,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = UE_mac_inst[module_idP].rxFrame,
.subframe = UE_mac_inst[module_idP].rxSubframe};
trace_pdu(&tmp);
}
......@@ -604,14 +610,15 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
stop_UE_TIMING(UE_mac_inst[module_idP].rx_si);
trace_pdu(DIRECTION_UPLINK,
(uint8_t *) pdu,
len,
module_idP,
WS_SI_RNTI,
0xffff,
UE_mac_inst[module_idP].rxFrame,
UE_mac_inst[module_idP].rxSubframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = pdu,
.pdu_buffer_size = len,
.ueid = module_idP,
.rntiType = WS_SI_RNTI,
.rnti = 0xffff,
.sysFrame = UE_mac_inst[module_idP].rxFrame,
.subframe = UE_mac_inst[module_idP].rxSubframe};
trace_pdu(&tmp);
}
void
......@@ -630,14 +637,15 @@ ue_decode_p(module_id_t module_idP, int CC_id, frame_t frameP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT);
stop_UE_TIMING(UE_mac_inst[module_idP].rx_p);
trace_pdu(DIRECTION_UPLINK,
(uint8_t *) pdu,
len,
module_idP,
WS_SI_RNTI,
P_RNTI,
UE_mac_inst[module_idP].rxFrame,
UE_mac_inst[module_idP].rxSubframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = pdu,
.pdu_buffer_size = len,
.ueid = module_idP,
.rntiType = WS_SI_RNTI,
.rnti = P_RNTI,
.sysFrame = UE_mac_inst[module_idP].rxFrame,
.subframe = UE_mac_inst[module_idP].rxSubframe};
trace_pdu(&tmp);
}
unsigned char *parse_mch_header(unsigned char *mac_header,
......@@ -2864,10 +2872,15 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT);
stop_UE_TIMING(UE_mac_inst[module_idP].tx_ulsch_sdu);
trace_pdu(DIRECTION_UPLINK, ulsch_buffer, buflen, module_idP, WS_C_RNTI,
UE_mac_inst[module_idP].crnti,
UE_mac_inst[module_idP].txFrame,
UE_mac_inst[module_idP].txSubframe, 0, 0);
ws_trace_t tmp = {.direction = DIRECTION_UPLINK,
.pdu_buffer = ulsch_buffer,
.pdu_buffer_size = buflen,
.ueid = module_idP,
.rntiType = WS_C_RNTI,
.rnti = UE_mac_inst[module_idP].crnti,
.sysFrame = UE_mac_inst[module_idP].txFrame,
.subframe = UE_mac_inst[module_idP].txSubframe};
trace_pdu(&tmp);
}
......
......@@ -215,8 +215,19 @@ static int nr_process_mac_pdu(instance_t module_idP,
NR_UE_UL_BWP_t *ul_bwp = &UE->current_UL_BWP;
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
if (pduP[0] != UL_SCH_LCID_PADDING)
trace_NRpdu(DIRECTION_UPLINK, pduP, pdu_len, WS_C_RNTI, UE->rnti, frameP, 0, 0, 0);
if (pduP[0] != UL_SCH_LCID_PADDING) {
ws_trace_t tmp = {.nr = true,
.direction = DIRECTION_UPLINK,
.pdu_buffer = pduP,
.pdu_buffer_size = pdu_len,
.ueid = 0,
.rntiType = WS_C_RNTI,
.rnti = UE->rnti,
.sysFrame = frameP,
.subframe = slot,
.harq_pid = harq_pid};
trace_pdu(&tmp);
}
#ifdef ENABLE_MAC_PAYLOAD_DEBUG
LOG_I(NR_MAC, "In %s: dumping MAC PDU in %d.%d:\n", __func__, frameP, slot);
......
......@@ -112,15 +112,29 @@ typedef enum radio_type_e {
*/
extern int opt_enabled;
#define trace_pdu(x...) if (opt_enabled) trace_pdu_implementation(0, x)
#define trace_NRpdu(x...) if (opt_enabled) nr_trace_pdu_implementation(1, x)
void trace_pdu_implementation(int nr, int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
int ueid, int rntiType, int rnti, uint16_t sysFrame, uint8_t subframe,
int oob_event, int oob_event_value);
void nr_trace_pdu_implementation(int nr, int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
int rntiType, int rnti, uint16_t sysFrame, uint8_t subframe,
int oob_event, int oob_event_value);
typedef struct {
bool nr;
int direction;
uint8_t *pdu_buffer;
unsigned int pdu_buffer_size;
int ueid;
int rntiType;
int rnti;
uint16_t sysFrame;
uint8_t subframe;
uint8_t harq_pid;
int oob_event;
int oob_event_value;
int crcStatus;
uint8_t isPredefinedData;
uint8_t retx;
} ws_trace_t;
#define trace_pdu(x) \
do { \
if (opt_enabled) \
trace_pdu_implementation(x); \
} while (0)
void trace_pdu_implementation(ws_trace_t *t);
int init_opt(void);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment