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