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) ...@@ -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); 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++) { 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", LOG_D(NR_MAC,
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), "Try to get a ul_tti_req by matching CRC active SFN_SLOT %d from queue with %lu items\n",
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), nr_ul_tti_req_queue.num_items); 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); 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) { if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0) {
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc); 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) ...@@ -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 sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset)
{ {
uint32_t new_sfnslot; 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); //printf("%s() sfn:%u sf:%u\n", __FUNCTION__, sfn, sf);
add_slot(&sfn, &slot, offset); add_slot(&sfn, &slot, offset);
...@@ -1443,9 +1441,9 @@ void pnf_handle_ul_tti_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7) ...@@ -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"); NFAPI_TRACE(NFAPI_TRACE_ERROR, "failed to unpack UL_TTI.request\n");
} else { } else {
NFAPI_TRACE(NFAPI_TRACE_NOTE, NFAPI_TRACE(NFAPI_TRACE_NOTE,
"[%d] NOT storing ul_tti_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SLOT %d\n", "[%d.%d] NOT storing ul_tti_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SLOT %d.%d\n",
NFAPI_SFNSLOT2DEC(pnf_p7->sfn, pnf_p7->slot), pnf_p7->sfn, pnf_p7->slot,
NFAPI_SFNSLOT2DEC(frame, slot)); frame, slot);
if (pnf_p7->_public.timing_info_mode_aperiodic) if (pnf_p7->_public.timing_info_mode_aperiodic)
pnf_p7->timing_info_aperiodic_send = 1; 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 ...@@ -1679,10 +1677,9 @@ void pnf_handle_tx_data_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7
} }
} else { } else {
NFAPI_TRACE(NFAPI_TRACE_INFO, NFAPI_TRACE(NFAPI_TRACE_INFO,
"%s() TX_DATA_REQUEST Request is outside of window REQ:SFN_SLOT:%d CURR:SFN_SLOT:%d\n", "TX_DATA_REQUEST Request is outside of window REQ:SFN_SLOT:%d.%d CURR:SFN_SLOT:%d.%d\n",
__FUNCTION__, frame, slot,
NFAPI_SFNSLOT2DEC(frame, slot), pnf_p7->sfn, pnf_p7->slot);
NFAPI_SFNSLOT2DEC(pnf_p7->sfn, pnf_p7->slot));
if (pnf_p7->_public.timing_info_mode_aperiodic) { if (pnf_p7->_public.timing_info_mode_aperiodic) {
pnf_p7->timing_info_aperiodic_send = 1; 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 ...@@ -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; 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", 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",
__FUNCTION__, now_time_hr, sfn, slot, slot_start_time_hr,
now_time_hr, NFAPI_SFNSLOT2DEC(sfn, slot), slot_start_time_hr,
slot_time_us, slot_time_us,
t2, t2,
prev_t2, prev_t2,
......
...@@ -1904,15 +1904,24 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7 ...@@ -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) 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", NFAPI_TRACE(NFAPI_TRACE_DEBUG,
// phy->sfn, phy->slot, ind.header.phy_id, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (slot_offset_filtered:%d) %d %d "
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, "%d NEW:%d.%d CURR:%d.%d adjustment:%d\n",
// phy->slot_offset_filtered, phy->sfn,
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend, phy->slot,
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot), ind.header.phy_id,
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot), phy->insync_minor_adjustment,
// phy->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 else
...@@ -1946,16 +1955,27 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7 ...@@ -1946,16 +1955,27 @@ void vnf_nr_handle_ul_node_sync(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_p7
{ {
// out of sync? // 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", NFAPI_TRACE(NFAPI_TRACE_DEBUG,
// phy->sfn, phy->slot, ind.header.phy_id, "(%4d/%d) VNF phy_id:%d Apply minor insync adjustment %dus for %d slots (adjustment:%d "
// phy->insync_minor_adjustment, phy->insync_minor_adjustment_duration, phy->adjustment, phy->slot_offset_filtered, "slot_offset_filtered:%d) %d %d %d NEW:%d.%d CURR:%d.%d adj:%d\n",
// insync_minor_adjustment_1, insync_minor_adjustment_2, phy->slot_offset_trend, phy->sfn,
// NFAPI_SFNSLOT2DEC(new_sfn, new_slot), phy->slot,
// NFAPI_SFNSLOT2DEC(curr_sfn, curr_slot), ind.header.phy_id,
// phy->adjustment); 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) else if(phy->adjustment < 0)
{ {
// VNF is fast // 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