Commit e051c9bb authored by Robert Schmidt's avatar Robert Schmidt

Simplify code: no time conversion macros necessary

The next commits will modify the time macros used in the 5G nFAPI code
to handle different numerologies. As a preparation, remove all the
usages of these macros where they really don't matter (e.g., don't
convert if we don't need to).
parent 5435585b
......@@ -197,9 +197,10 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n",
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), nr_ul_tti_req_queue.num_items);
LOG_D(NR_MAC,
"Try to get a ul_tti_req by matching CRC active SFN_SLOT %d from queue with %lu items\n",
sfn_slot,
nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot);
if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) {
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc);
......
......@@ -64,8 +64,6 @@ void subtract_sf(uint16_t *frameP, uint16_t *subframeP, int offset)
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset)
{
uint32_t new_sfnslot;
// uint16_t sfn = NFAPI_SFNSLOT2SFN(sfnslot);
// uint16_t slot = NFAPI_SFNSLOT2SLOT(sfnslot);
//printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
add_slot(&sfn, &slot, offset);
......@@ -1443,9 +1441,9 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
NFAPI_TRACE(NFAPI_TRACE_ERROR, "failed to unpack UL_TTI.request\n");
} else {
NFAPI_TRACE(NFAPI_TRACE_NOTE,
"[%d] NOT storing ul_tti_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SLOT %d\n",
NFAPI_SFNSLOT2DEC(pnf_p7->sfn, pnf_p7->slot),
NFAPI_SFNSLOT2DEC(frame, slot));
"[%d.%d] NOT storing ul_tti_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SLOT %d.%d\n",
pnf_p7->sfn, pnf_p7->slot,
frame, slot);
if (pnf_p7->_public.timing_info_mode_aperiodic)
pnf_p7->timing_info_aperiodic_send = 1;
......@@ -1679,10 +1677,9 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
}
} else {
NFAPI_TRACE(NFAPI_TRACE_INFO,
"%s() TX_DATA_REQUEST Request is outside of window REQ:SFN_SLOT:%d CURR:SFN_SLOT:%d\n",
__FUNCTION__,
NFAPI_SFNSLOT2DEC(frame, slot),
NFAPI_SFNSLOT2DEC(pnf_p7->sfn, pnf_p7->slot));
"TX_DATA_REQUEST Request is outside of window REQ:SFN_SLOT:%d.%d CURR:SFN_SLOT:%d.%d\n",
frame, slot,
pnf_p7->sfn, pnf_p7->slot);
if (pnf_p7->_public.timing_info_mode_aperiodic) {
pnf_p7->timing_info_aperiodic_send = 1;
......@@ -1969,9 +1966,8 @@ uint32_t calculate_nr_t2(uint32_t now_time_hr, uint16_t sfn,uint16_t slot, uint3
{
static uint32_t prev_t2 = 0;
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s(now_time_hr:%u sfn to slot:%d slot_start_time_Hr:%u) slot_time_us:%u t2:%u prev_t2:%u diff:%u\n",
__FUNCTION__,
now_time_hr, NFAPI_SFNSLOT2DEC(sfn, slot), slot_start_time_hr,
NFAPI_TRACE(NFAPI_TRACE_ERROR, "(now_time_hr:%u sfn.slot:%d.%d slot_start_time_Hr:%u) slot_time_us:%u t2:%u prev_t2:%u diff:%u\n",
now_time_hr, sfn, slot, slot_start_time_hr,
slot_time_us,
t2,
prev_t2,
......
......@@ -1904,15 +1904,24 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
if(phy->insync_minor_adjustment != 0)
{
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adjustment:%d\n",
// phy->sfn, phy->slot, ind.header.phy_id,
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration,
// phy->slot_offset_filtered,
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
// phy->adjustment);
}
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
"(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d "
"%d NEW:%d.%d CURR:%d.%d adjustment:%d\n",
phy->sfn,
phy->slot,
ind.header.phy_id,
phy->insync_minor_adjustment,
phy->insync_minor_adjustment_duration,
phy->slot_offset_filtered,
insync_minor_adjustment_1,
insync_minor_adjustment_2,
phy->slot_offset_trend,
new_sfn,
new_slot,
curr_sfn,
curr_slot,
phy->adjustment);
}
}
}
else
......@@ -1946,16 +1955,27 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
{
// out of sync?
}
// NFAPI_TRACE(NFAPI_TRACE_NOTE, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d slot_offset_filtered:%d) %d %d %d NEW:%d CURR:%d adj:%d\n",
// phy->sfn, phy->slot, ind.header.phy_id,
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered,
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend,
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot),
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot),
// phy->adjustment);
}
NFAPI_TRACE(NFAPI_TRACE_DEBUG,
"(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d "
"slot_offset_filtered:%d) %d %d %d NEW:%d.%d CURR:%d.%d adj:%d\n",
phy->sfn,
phy->slot,
ind.header.phy_id,
phy->insync_minor_adjustment,
phy->insync_minor_adjustment_duration,
phy->adjustment,
phy->slot_offset_filtered,
insync_minor_adjustment_1,
insync_minor_adjustment_2,
phy->slot_offset_trend,
new_sfn,
new_slot,
curr_sfn,
curr_slot,
phy->adjustment);
}
else if(phy->adjustment < 0)
{
// VNF is fast
......
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