Commit 11fd202d authored by laurent's avatar laurent

fix compilation, attach complete

parent c17f65f1
...@@ -63,7 +63,7 @@ struct msghdr nas_msg_tx; ...@@ -63,7 +63,7 @@ struct msghdr nas_msg_tx;
struct msghdr nas_msg_rx; struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31 #define GRAAL_NETLINK_ID 31
#ifdef UE_NAS_USE_TUN #ifdef UE_NAS_USE_TUN
static int tun_alloc(char *dev) static int tun_alloc(char *dev)
......
...@@ -3299,6 +3299,7 @@ int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, ...@@ -3299,6 +3299,7 @@ int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
msg_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_NEXT_CELL_REQ); msg_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_NEXT_CELL_REQ);
itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p); itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p);
LOG_E(RRC, "Synched with a cell, but PLMN doesn't match our SIM, the message PHY_FIND_NEXT_CELL_REQ is sent but lost in current UE implementation! \n");
} }
} }
#endif #endif
...@@ -5111,6 +5112,7 @@ void *rrc_ue_task( void *args_p ) ...@@ -5111,6 +5112,7 @@ void *rrc_ue_task( void *args_p )
break; // PHY_FIND_CELL_IND break; // PHY_FIND_CELL_IND
case PHY_MEAS_REPORT_IND: { case PHY_MEAS_REPORT_IND: {
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_MEASUREMENT_REPORT_IND); message_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_MEASUREMENT_REPORT_IND);
...@@ -5128,6 +5130,7 @@ void *rrc_ue_task( void *args_p ) ...@@ -5128,6 +5130,7 @@ void *rrc_ue_task( void *args_p )
} }
case RRC_RAL_CONFIGURE_THRESHOLD_REQ: 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); rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p);
break; break;
......
...@@ -280,7 +280,7 @@ bool flushInput(tcp_bridge_state_t *t) { ...@@ -280,7 +280,7 @@ bool flushInput(tcp_bridge_state_t *t) {
else else
blockSz= b->transferPtr+b->remainToTransfer < b->circularBufEnd ? blockSz= b->transferPtr+b->remainToTransfer < b->circularBufEnd ?
b->remainToTransfer : b->remainToTransfer :
b->circularBufEnd - b->transferPtr; b->circularBufEnd - 1 - b->transferPtr ;
int sz=recv(fd, b->transferPtr, blockSz, MSG_DONTWAIT); int sz=recv(fd, b->transferPtr, blockSz, MSG_DONTWAIT);
...@@ -294,6 +294,8 @@ bool flushInput(tcp_bridge_state_t *t) { ...@@ -294,6 +294,8 @@ bool flushInput(tcp_bridge_state_t *t) {
AssertFatal((b->remainToTransfer-=sz) >= 0, ""); AssertFatal((b->remainToTransfer-=sz) >= 0, "");
b->transferPtr+=sz; b->transferPtr+=sz;
if (b->transferPtr==b->circularBufEnd - 1)
b->transferPtr=(char*)b->circularBuf;
// check the header and start block transfer // check the header and start block transfer
if ( b->headerMode==true && b->remainToTransfer==0) { if ( b->headerMode==true && b->remainToTransfer==0) {
......
This diff is collapsed.
...@@ -783,11 +783,18 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -783,11 +783,18 @@ static void *UE_thread_rxn_txnp4(void *arg) {
threadname); threadname);
while (!oai_exit) { while (!oai_exit) {
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) {
while (proc->instance_cnt_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 // most of the time, the thread is waiting here
pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); 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(t2);
initRefTimes(t3); initRefTimes(t3);
...@@ -861,12 +868,18 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -861,12 +868,18 @@ static void *UE_thread_rxn_txnp4(void *arg) {
phy_procedures_UE_S_TX(UE,0,0); phy_procedures_UE_S_TX(UE,0,0);
updateTimes(current, &t3, 10000, "Delay to process sub-frame (case 3)"); 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--; proc->instance_cnt_rxtx--;
#if BASIC_SIMULATOR #if 1 //BASIC_SIMULATOR
AssertFatal (pthread_cond_signal(&proc->cond_rxtx) == 0, ""); if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort();
#endif #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 // thread finished
...@@ -981,6 +994,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { ...@@ -981,6 +994,7 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
} }
while (phy_stub_ticking->ticking_var < 0) { while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here // 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"); LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking); pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
} }
...@@ -1265,6 +1279,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) { ...@@ -1265,6 +1279,7 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
} }
while (phy_stub_ticking->ticking_var < 0) { while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here // 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"); LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking); pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
} }
...@@ -1456,12 +1471,6 @@ void *UE_thread(void *arg) { ...@@ -1456,12 +1471,6 @@ void *UE_thread(void *arg) {
} }
while (!oai_exit) { 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), ""); AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
int instance_cnt_synch = UE->proc.instance_cnt_synch; int instance_cnt_synch = UE->proc.instance_cnt_synch;
...@@ -1591,7 +1600,7 @@ void *UE_thread(void *arg) { ...@@ -1591,7 +1600,7 @@ void *UE_thread(void *arg) {
// update thread index for received subframe // update thread index for received subframe
UE->current_thread_id[sub_frame] = thread_idx; UE->current_thread_id[sub_frame] = thread_idx;
#if BASIC_SIMULATOR #if 1 //BASIC_SIMULATOR
{ {
int t; int t;
for (t = 0; t < 2; t++) { for (t = 0; t < 2; t++) {
...@@ -1629,10 +1638,10 @@ void *UE_thread(void *arg) { ...@@ -1629,10 +1638,10 @@ void *UE_thread(void *arg) {
// compute TO compensation that should be applied for this frame // compute TO compensation that should be applied for this frame
if (UE->no_timing_correction == 0) { if (UE->no_timing_correction == 0) {
if ( getenv("RFSIMULATOR") != NULL && UE->rx_offset) { if (UE->rx_offset) {
//LOG_E(HW,"in simu, rx_offset is not null (impossible): %d\n", UE->rx_offset); //LOG_E(HW,"in simu, rx_offset is not null: %d\n", UE->rx_offset);
UE->rx_offset=0; UE->rx_offset=0;
} }
if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti && if ( UE->rx_offset < 5*UE->frame_parms.samples_per_tti &&
UE->rx_offset > 0 ) UE->rx_offset > 0 )
UE->rx_offset_diff = -1 ; UE->rx_offset_diff = -1 ;
...@@ -1704,6 +1713,7 @@ void *UE_thread(void *arg) { ...@@ -1704,6 +1713,7 @@ void *UE_thread(void *arg) {
proc->instance_cnt_rxtx++; 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); 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 (proc->instance_cnt_rxtx != 0) {
/*
if ( getenv("RFSIMULATOR") != NULL ) { if ( getenv("RFSIMULATOR") != NULL ) {
do { do {
AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, ""); AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "");
...@@ -1711,7 +1721,7 @@ void *UE_thread(void *arg) { ...@@ -1711,7 +1721,7 @@ void *UE_thread(void *arg) {
AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, ""); AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "");
} while ( proc->instance_cnt_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); 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) if (proc->instance_cnt_rxtx > 2)
exit_fun("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