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).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user