Commit 077cec4e authored by laurent's avatar laurent Committed by frtabu

fix compilation, attach complete

parent c1bbb1b2
......@@ -63,7 +63,7 @@ struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31
#ifdef UE_NAS_USE_TUN
static int tun_alloc(char *dev)
......
......@@ -4670,7 +4670,6 @@ void *rrc_ue_task( void *args_p ) {
itti_send_msg_to_task(TASK_RAL_UE, instance, message_p);
break;
}
case RRC_RAL_CONFIGURE_THRESHOLD_REQ:
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p);
......@@ -4687,7 +4686,6 @@ void *rrc_ue_task( void *args_p ) {
LOG_D(RRC, "not sending connection request\n");
rrc_set_sub_state (ue_mod_id, RRC_SUB_STATE_IDLE_CONNECTING);
}
break;
}
......
......@@ -280,7 +280,7 @@ bool flushInput(tcp_bridge_state_t *t) {
else
blockSz= b->transferPtr+b->remainToTransfer < b->circularBufEnd ?
b->remainToTransfer :
b->circularBufEnd - b->transferPtr;
b->circularBufEnd - 1 - b->transferPtr ;
int sz=recv(fd, b->transferPtr, blockSz, MSG_DONTWAIT);
......@@ -294,6 +294,8 @@ bool flushInput(tcp_bridge_state_t *t) {
AssertFatal((b->remainToTransfer-=sz) >= 0, "");
b->transferPtr+=sz;
if (b->transferPtr==b->circularBufEnd - 1)
b->transferPtr=(char*)b->circularBuf;
// check the header and start block transfer
if ( b->headerMode==true && b->remainToTransfer==0) {
......
This diff is collapsed.
......@@ -785,11 +785,18 @@ static void *UE_thread_rxn_txnp4(void *arg) {
threadname);
while (!oai_exit) {
AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error locking mutex for UE RXTX\n" );
while (proc->instance_cnt_rxtx < 0)
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("nothing to add");
}
while (proc->instance_cnt_rxtx < 0) {
// most of the time, the thread is waiting here
pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
}
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
exit_fun("nothing to add");
}
initRefTimes(t2);
initRefTimes(t3);
......@@ -863,12 +870,18 @@ static void *UE_thread_rxn_txnp4(void *arg) {
phy_procedures_UE_S_TX(UE,0,0);
updateTimes(current, &t3, 10000, "Delay to process sub-frame (case 3)");
AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error locking mutex for UE RXTX\n" );
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("noting to add");
}
proc->instance_cnt_rxtx--;
#if BASIC_SIMULATOR
AssertFatal (pthread_cond_signal(&proc->cond_rxtx) == 0, "");
#if 1 //BASIC_SIMULATOR
if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort();
#endif
AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error unlocking mutex for UE RXTX\n" );
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXTX\n" );
exit_fun("noting to add");
}
}
// thread finished
......@@ -1012,6 +1025,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
}
while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here
//pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx )
LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
}
......@@ -1363,6 +1377,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
}
while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here
//pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx )
LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
}
......@@ -1554,12 +1569,6 @@ void *UE_thread(void *arg) {
}
while (!oai_exit) {
#if BASIC_SIMULATOR
while (!(UE->proc.instance_cnt_synch < 0)) {
printf("ue sync not ready\n");
usleep(500*1000);
}
#endif
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
int instance_cnt_synch = UE->proc.instance_cnt_synch;
......@@ -1689,7 +1698,7 @@ void *UE_thread(void *arg) {
// update thread index for received subframe
UE->current_thread_id[sub_frame] = thread_idx;
#if BASIC_SIMULATOR
#if 1 //BASIC_SIMULATOR
{
int t;
for (t = 0; t < 2; t++) {
......@@ -1727,10 +1736,10 @@ void *UE_thread(void *arg) {
// compute TO compensation that should be applied for this frame
if (UE->no_timing_correction == 0) {
if ( getenv("RFSIMULATOR") != NULL && UE->rx_offset) {
//LOG_E(HW,"in simu, rx_offset is not null (impossible): %d\n", UE->rx_offset);
UE->rx_offset=0;
}
if (UE->rx_offset) {
//LOG_E(HW,"in simu, rx_offset is not null: %d\n", UE->rx_offset);
UE->rx_offset=0;
}
if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti &&
UE->rx_offset > 0 )
UE->rx_offset_diff = -1 ;
......@@ -1802,6 +1811,7 @@ void *UE_thread(void *arg) {
proc->instance_cnt_rxtx++;
LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx);
if (proc->instance_cnt_rxtx != 0) {
/*
if ( getenv("RFSIMULATOR") != NULL ) {
do {
AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "");
......@@ -1809,7 +1819,7 @@ void *UE_thread(void *arg) {
AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "");
} while ( proc->instance_cnt_rxtx >= 0);
} else
} else */
LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", UE->Mod_id, proc->instance_cnt_rxtx);
if (proc->instance_cnt_rxtx > 2)
exit_fun("instance_cnt_rxtx > 2");
......
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