Use an enum for stream_status states
This commit is contained in:
+7
-7
@@ -529,7 +529,7 @@ void processSlotTX(void *arg)
|
|||||||
// Force sequential execution, even if we launch in // for all slots
|
// Force sequential execution, even if we launch in // for all slots
|
||||||
// at least ULstatus variable is a pure race condition that is quickly detected by assert() in the code because one thread sets it
|
// at least ULstatus variable is a pure race condition that is quickly detected by assert() in the code because one thread sets it
|
||||||
// to active, so the other thread try to steal&run the ul work
|
// to active, so the other thread try to steal&run the ul work
|
||||||
if (rxtxD->stream_status == 2) {
|
if (rxtxD->stream_status == STREAM_STATUS_SYNCED) {
|
||||||
notifiedFIFO_elt_t *res = pullNotifiedFIFO(UE->tx_resume_ind_fifo + proc->nr_slot_tx);
|
notifiedFIFO_elt_t *res = pullNotifiedFIFO(UE->tx_resume_ind_fifo + proc->nr_slot_tx);
|
||||||
delNotifiedFIFO_elt(res);
|
delNotifiedFIFO_elt(res);
|
||||||
}
|
}
|
||||||
@@ -751,7 +751,7 @@ void *UE_thread(void *arg)
|
|||||||
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
|
PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
|
||||||
// int tx_enabled = 0;
|
// int tx_enabled = 0;
|
||||||
void *rxp[NB_ANTENNAS_RX];
|
void *rxp[NB_ANTENNAS_RX];
|
||||||
int start_rx_stream = 0;
|
enum stream_status_e stream_status = STREAM_STATUS_UNSYNC;
|
||||||
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
|
fapi_nr_config_request_t *cfg = &UE->nrUE_config;
|
||||||
int tmp = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
int tmp = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
|
||||||
AssertFatal(tmp == 0, "Could not load the device\n");
|
AssertFatal(tmp == 0, "Could not load the device\n");
|
||||||
@@ -801,7 +801,7 @@ void *UE_thread(void *arg)
|
|||||||
intialSyncOffset = syncMsg->rx_offset;
|
intialSyncOffset = syncMsg->rx_offset;
|
||||||
}
|
}
|
||||||
delNotifiedFIFO_elt(res);
|
delNotifiedFIFO_elt(res);
|
||||||
start_rx_stream = 0;
|
stream_status = STREAM_STATUS_UNSYNC;
|
||||||
} else {
|
} else {
|
||||||
if (IS_SOFTMODEM_IQPLAYER || IS_SOFTMODEM_IQRECORDER) {
|
if (IS_SOFTMODEM_IQPLAYER || IS_SOFTMODEM_IQRECORDER) {
|
||||||
// For IQ recorder-player we force synchronization to happen in 280 ms
|
// For IQ recorder-player we force synchronization to happen in 280 ms
|
||||||
@@ -831,8 +831,8 @@ void *UE_thread(void *arg)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start_rx_stream == 0) {
|
if (stream_status == STREAM_STATUS_UNSYNC) {
|
||||||
start_rx_stream=1;
|
stream_status = STREAM_STATUS_SYNCING;
|
||||||
syncInFrame(UE, &sync_timestamp, intialSyncOffset);
|
syncInFrame(UE, &sync_timestamp, intialSyncOffset);
|
||||||
shiftForNextFrame = 0; // will be used to track clock drift
|
shiftForNextFrame = 0; // will be used to track clock drift
|
||||||
// read in first symbol
|
// read in first symbol
|
||||||
@@ -949,8 +949,8 @@ void *UE_thread(void *arg)
|
|||||||
curMsgTx->proc.timestamp_tx = writeTimestamp;
|
curMsgTx->proc.timestamp_tx = writeTimestamp;
|
||||||
curMsgTx->UE = UE;
|
curMsgTx->UE = UE;
|
||||||
curMsgTx->tx_wait_for_dlsch = tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx];
|
curMsgTx->tx_wait_for_dlsch = tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx];
|
||||||
curMsgTx->stream_status = start_rx_stream;
|
curMsgTx->stream_status = stream_status;
|
||||||
start_rx_stream = 2;
|
stream_status = STREAM_STATUS_SYNCED;
|
||||||
tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx] = 0;
|
tx_wait_for_dlsch[curMsgTx->proc.nr_slot_tx] = 0;
|
||||||
pushTpool(&(get_nrUE_params()->Tpool), newTx);
|
pushTpool(&(get_nrUE_params()->Tpool), newTx);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -632,6 +632,8 @@ typedef struct nr_phy_data_s {
|
|||||||
sl_nr_rx_config_type_enum_t sl_rx_action;
|
sl_nr_rx_config_type_enum_t sl_rx_action;
|
||||||
|
|
||||||
} nr_phy_data_t;
|
} nr_phy_data_t;
|
||||||
|
|
||||||
|
enum stream_status_e { STREAM_STATUS_UNSYNC, STREAM_STATUS_SYNCING, STREAM_STATUS_SYNCED};
|
||||||
/* this structure is used to pass both UE phy vars and
|
/* this structure is used to pass both UE phy vars and
|
||||||
* proc to the function UE_thread_rxn_txnp4
|
* proc to the function UE_thread_rxn_txnp4
|
||||||
*/
|
*/
|
||||||
@@ -642,7 +644,7 @@ typedef struct nr_rxtx_thread_data_s {
|
|||||||
nr_phy_data_t phy_data;
|
nr_phy_data_t phy_data;
|
||||||
int tx_wait_for_dlsch;
|
int tx_wait_for_dlsch;
|
||||||
int rx_offset;
|
int rx_offset;
|
||||||
int stream_status;
|
enum stream_status_e stream_status;
|
||||||
} nr_rxtx_thread_data_t;
|
} nr_rxtx_thread_data_t;
|
||||||
|
|
||||||
typedef struct LDPCDecode_ue_s {
|
typedef struct LDPCDecode_ue_s {
|
||||||
|
|||||||
Reference in New Issue
Block a user