Cleanup common_lib.h

This change reduces the number of dependecies of common_lib.h and simplifies
the task of implementing an external OAI radio library.
This commit is contained in:
Bartosz Podrygajlo
2026-03-31 11:50:35 +02:00
parent af4b0d53e9
commit e4d2d2b827
33 changed files with 77 additions and 50 deletions
+3 -5
View File
@@ -365,7 +365,8 @@ void *trx_eth_write_udp_cmd(udpTXelem_t *udpTXelem)
int trx_eth_write_udp(openair0_device_t *device, openair0_timestamp_t timestamp, void **buff, int fd_ind, int nsamps, int flags, int nant)
{
union udpTXReqUnion id = {.s={(uint64_t)timestamp,nsamps,0}};
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(udpTXelem_t), id.p, device->utx[fd_ind]->resp,NULL);
eth_state_t *eth = (eth_state_t*)device->priv;
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(udpTXelem_t), id.p, eth->utx[fd_ind]->resp,NULL);
udpTXelem_t * udptxelem=(udpTXelem_t *) NotifiedFifoData(req);
udptxelem->device = device;
udptxelem->timestamp = timestamp;
@@ -375,7 +376,7 @@ int trx_eth_write_udp(openair0_device_t *device, openair0_timestamp_t timestamp,
udptxelem->nsamps = nsamps;
udptxelem->flags = flags;
udptxelem->nant = nant;
pushNotifiedFIFO(device->utx[fd_ind]->resp, req);
pushNotifiedFIFO(eth->utx[fd_ind]->resp, req);
LOG_D(PHY,"Pushed to TX FH FIFO, TS %llu, nsamps %d, nant %d buffs[0] %p buffs[1] %p\n",
(unsigned long long)timestamp,nsamps,nant,udptxelem->buff[0],udptxelem->buff[1]);
return(0);
@@ -386,14 +387,11 @@ void *udp_write_thread(void *arg) {
utx->resp = malloc(sizeof(*utx->resp));
initNotifiedFIFO(utx->resp);
LOG_D(PHY,"UDP write thread started on core %d\n",sched_getcpu());
reset_meas(&utx->device->tx_fhaul);
while (oai_exit == 0) {
notifiedFIFO_elt_t *res = pullNotifiedFIFO(utx->resp);
udpTXelem_t *udptxelem = (udpTXelem_t *)NotifiedFifoData(res);
LOG_D(PHY,"Pulled from TX FH FIFO, TS %llu, nsamps %d, nant %d\n",(unsigned long long)udptxelem->timestamp,udptxelem->nsamps,udptxelem->nant);
start_meas(&utx->device->tx_fhaul);
trx_eth_write_udp_cmd(udptxelem);
stop_meas(&utx->device->tx_fhaul);
// send data to RU
delNotifiedFIFO_elt(res);
}