LOG_I(HW,"[SCHED][eNB] PRACH thread started on CPU %d TID %ld, IC %d, sched_policy = %s, priority = %d, CPU Affinity = %s\n",sched_getcpu(),gettid(),proc->instance_cnt_prach,
#if defined(ENABLE_ITTI)
(policy==SCHED_FIFO)?"SCHED_FIFO":
if(eNB->node_function<NGFI_RRU_IF5)
(policy==SCHED_RR)?"SCHED_RR":
wait_system_ready("Waiting for eNB application to be ready %s\r",&start_eNB);
(policy==SCHED_OTHER)?"SCHED_OTHER":
#endif
"???",
sparam.sched_priority,cpu_affinity);
// Start IF device if any
if(eNB->start_if)
if(eNB->start_if(eNB)!=0)
LOG_E(HW,"Could not start the IF device\n");
#endif // DEADLINE_SCHEDULER
// Start RF device if any
if(eNB->start_rf)
if(eNB->start_rf(eNB)!=0)
LOG_E(HW,"Could not start the RF device\n");
mlockall(MCL_CURRENT|MCL_FUTURE);
// wakeup asnych_rxtx thread because the devices are ready at this point
pthread_mutex_lock(&proc->mutex_asynch_rxtx);
proc->instance_cnt_asynch_rxtx=0;
pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
pthread_cond_signal(&proc->cond_asynch_rxtx);
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while(!oai_exit){
while(!oai_exit){
if(oai_exit)break;
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// They are set on the first rx/tx in the underly FH routines.
if(pthread_mutex_lock(&proc->mutex_prach)!=0){
if(subframe==9){
LOG_E(PHY,"[SCHED][eNB] error locking mutex for eNB PRACH\n");
subframe=0;
exit_fun("error locking mutex");
frame++;
break;
frame&=1023;
}else{
subframe++;
}
}
while(proc->instance_cnt_prach<0){
// most of the time the thread is waiting here
// proc->instance_cnt_prach is -1
pthread_cond_wait(&proc->cond_prach,&proc->mutex_prach);// this unlocks mutex_rxtx while waiting and then locks it again
}
if(pthread_mutex_unlock(&proc->mutex_prach)!=0){
// synchronization on FH interface, acquire signals/data and block
LOG_E(PHY,"[SCHED][eNB] error unlocking mutex for eNB PRACH\n");
* \brief provides a wrapper for the timing function for real-time opeartions depending on weather RTAI is used or not. It also implements an API for the SCHED_DEADLINE kernel scheduler.
* \brief provides a wrapper for the timing function for real-time opeartions. It also implements an API for the SCHED_DEADLINE kernel scheduler.