Commit 0e5bc42e authored by Robert Schmidt's avatar Robert Schmidt

FHI72: no poll: use pullNotifiedFIFO(), cleanup code, make compile

Move the extern definition to the header, to avoid type errors.
parent 2cd0bba9
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include "oran-config.h" // for g_kbar #include "oran-config.h" // for g_kbar
#include "common/utils/threadPool/notified_fifo.h"
#define USE_POLLING 1 #define USE_POLLING 1
// Declare variable useful for the send buffer function // Declare variable useful for the send buffer function
volatile uint8_t first_call_set = 0; volatile uint8_t first_call_set = 0;
...@@ -130,19 +132,17 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status) ...@@ -130,19 +132,17 @@ void oai_xran_fh_rx_callback(void *pCallbackTag, xran_status_t status)
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 = (oran_sync_info_t *)NotifiedFifoData(req); oran_sync_info_t *info = NotifiedFifoData(req);
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);
#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
#ifndef USE_POLLING
pushNotifiedFIFO(&oran_sync_fifo, req);
#else
#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);
...@@ -271,7 +271,6 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) ...@@ -271,7 +271,6 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
void *ptr = NULL; void *ptr = NULL;
int32_t *pos = NULL; int32_t *pos = NULL;
int idx = 0; int idx = 0;
static int last_slot = -1;
first_read_set = 1; first_read_set = 1;
static int64_t old_rx_counter[XRAN_PORTS_NUM] = {0}; static int64_t old_rx_counter[XRAN_PORTS_NUM] = {0};
...@@ -280,11 +279,8 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) ...@@ -280,11 +279,8 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
static int outcnt = 0; static int outcnt = 0;
#ifndef USE_POLLING #ifndef USE_POLLING
// pull next even from oran_sync_fifo // pull next even from oran_sync_fifo
notifiedFIFO_elt_t *res = pollNotifiedFIFO(&oran_sync_fifo); notifiedFIFO_elt_t *res = pullNotifiedFIFO(&oran_sync_fifo);
while (res == NULL) { oran_sync_info_t *info = NotifiedFifoData(res);
res = pollNotifiedFIFO(&oran_sync_fifo);
}
oran_sync_info_t *info = (oran_sync_info_t *)NotifiedFifoData(res);
*slot = info->sl; *slot = info->sl;
*frame = info->f; *frame = info->f;
...@@ -298,6 +294,7 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) ...@@ -298,6 +294,7 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot)
*frame = oran_sync_info.f; *frame = oran_sync_info.f;
uint32_t tti_in = oran_sync_info.tti; uint32_t tti_in = oran_sync_info.tti;
static int last_slot = -1;
LOG_D(PHY, "oran slot %d, last_slot %d\n", *slot, last_slot); LOG_D(PHY, "oran slot %d, last_slot %d\n", *slot, last_slot);
int cnt = 0; int cnt = 0;
// while (*slot == last_slot) { // while (*slot == last_slot) {
......
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