Reduce indentation, add comment
Reduce one level of indentation, and explain why we wait for physide_dl_tti callback.
This commit is contained in:
+32
-29
@@ -112,39 +112,42 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (first_call_set) {
|
// if xran did not call xran_physide_dl_tti callback, it's not ready yet.
|
||||||
slot2 = slot + (subframe * slots_per_subframe);
|
// wait till first callback to advance counters, because otherwise users
|
||||||
rx_RU[ru_id][slot2] = 1;
|
// would see periodic output with only "0" in stats counters
|
||||||
if (last_frame > 0 && frame > 0
|
if (!first_call_set)
|
||||||
&& ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023))))
|
return;
|
||||||
LOG_E(PHY, "Jump in frame counter last_frame %d => %d, slot %d\n", last_frame, frame, slot2);
|
slot2 = slot + (subframe * slots_per_subframe);
|
||||||
for (int i = 0; i < num_ports; i++) {
|
rx_RU[ru_id][slot2] = 1;
|
||||||
if (rx_RU[i][slot2] == 0)
|
if (last_frame > 0 && frame > 0
|
||||||
return;
|
&& ((slot2 > 0 && last_frame != frame) || (slot2 == 0 && last_frame != ((1024 + frame - 1) & 1023))))
|
||||||
}
|
LOG_E(PHY, "Jump in frame counter last_frame %d => %d, slot %d\n", last_frame, frame, slot2);
|
||||||
for (int i = 0; i < num_ports; i++)
|
for (int i = 0; i < num_ports; i++) {
|
||||||
rx_RU[i][slot2] = 0;
|
if (rx_RU[i][slot2] == 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < num_ports; i++)
|
||||||
|
rx_RU[i][slot2] = 0;
|
||||||
|
|
||||||
if (last_slot == -1 || slot2 != last_slot) {
|
if (last_slot == -1 || slot2 != last_slot) {
|
||||||
#ifndef USE_POLLING
|
#ifndef USE_POLLING
|
||||||
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(oran_sync_info_t), 0, &oran_sync_fifo, NULL);
|
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(oran_sync_info_t), 0, &oran_sync_fifo, NULL);
|
||||||
oran_sync_info_t *info = NotifiedFifoData(req);
|
oran_sync_info_t *info = NotifiedFifoData(req);
|
||||||
info->tti = tti;
|
info->tti = tti;
|
||||||
info->sl = slot2;
|
info->sl = slot2;
|
||||||
info->f = frame;
|
info->f = frame;
|
||||||
LOG_D(PHY, "Push %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, info->sl, slot, ru_id, subframe, last_slot);
|
LOG_D(PHY, "Push %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, info->sl, slot, ru_id, subframe, last_slot);
|
||||||
pushNotifiedFIFO(&oran_sync_fifo, req);
|
pushNotifiedFIFO(&oran_sync_fifo, req);
|
||||||
#else
|
#else
|
||||||
LOG_D(PHY, "Writing %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, slot2, ru_id, slot, subframe, last_slot);
|
LOG_D(PHY, "Writing %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, slot2, ru_id, slot, subframe, last_slot);
|
||||||
oran_sync_info.tti = tti;
|
oran_sync_info.tti = tti;
|
||||||
oran_sync_info.sl = slot2;
|
oran_sync_info.sl = slot2;
|
||||||
oran_sync_info.f = frame;
|
oran_sync_info.f = frame;
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
LOG_E(PHY, "Cannot Push %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, slot2, ru_id, slot, subframe, last_slot);
|
LOG_E(PHY, "Cannot Push %d.%d.%d (slot %d, subframe %d,last_slot %d)\n", frame, slot2, ru_id, slot, subframe, last_slot);
|
||||||
last_slot = slot2;
|
last_slot = slot2;
|
||||||
last_frame = frame;
|
last_frame = frame;
|
||||||
} // first_call_set
|
|
||||||
} // rx_sym == 7
|
} // rx_sym == 7
|
||||||
}
|
}
|
||||||
void oai_xran_fh_srs_callback(void *pCallbackTag, xran_status_t status)
|
void oai_xran_fh_srs_callback(void *pCallbackTag, xran_status_t status)
|
||||||
|
|||||||
Reference in New Issue
Block a user