Commit db7b1f59 authored by Wang Tsu-Han's avatar Wang Tsu-Han

phy test fix

parent 184d51c6
......@@ -425,11 +425,11 @@ typedef struct RU_proc_t_s {
pthread_cond_t cond_synch;
/// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx;
/// condition varible for RU RX FEP thread
/// condition variable for RU RX FEP thread
pthread_cond_t cond_fep;
/// condition varible for RU TX FEP thread
/// condition variable for RU TX FEP thread
pthread_cond_t cond_feptx;
/// condition varible for emulated RF
/// condition variable for emulated RF
pthread_cond_t cond_emulateRF;
/// condition variable for eNB signal
pthread_cond_t cond_eNBs;
......@@ -702,7 +702,6 @@ typedef enum {
REMOTE_IF4p5 =3,
REMOTE_IF1pp =4,
MAX_RU_IF_TYPES =5
//EMULATE_RF =6
} RU_if_south_t;
typedef struct RU_t_s{
......
......@@ -167,6 +167,16 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
#endif
harq_pid = dlsch0->harq_ids[subframe];
LOG_I(PHY,"handle_nfapi_dlsch_pdu subframe = %d harq_ids = [%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n", subframe,dlsch0->harq_ids[0],
dlsch0->harq_ids[1],
dlsch0->harq_ids[2],
dlsch0->harq_ids[3],
dlsch0->harq_ids[4],
dlsch0->harq_ids[5],
dlsch0->harq_ids[6],
dlsch0->harq_ids[7],
dlsch0->harq_ids[8],
dlsch0->harq_ids[9]);/////////////*********added
AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n",
harq_pid,
frame,subframe,
......@@ -624,7 +634,6 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
AssertFatal(RC.eNB[Mod_id][CC_id]!=NULL,"RC.eNB[%d][%d] is null\n",Mod_id,CC_id);
eNB = RC.eNB[Mod_id][CC_id];
fp = &eNB->frame_parms;
proc = &eNB->proc.proc_rxtx[0];
......@@ -672,6 +681,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
LOG_D(PHY,"NFAPI: Clearing dci allocations for potential UL subframe %d\n",ul_subframe);
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
LOG_I(PHY,"schedule_response %d.%d UL %d.%d harq_pid = %d\n", frame, subframe, ul_frame, ul_subframe, harq_pid);/////////////*********added
// clear DCI allocation maps for new subframe
......@@ -685,9 +695,10 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
}
for (i=0;i<number_dl_pdu;i++) {
dl_config_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i];
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
LOG_I(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);/////////////*********LOG_D with mark out
switch (dl_config_pdu->pdu_type) {
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
//LOG_I(PHY,"NFAPI: dl_pdu %d : type %d executing handle_nfapi_dci_dl_pdu()\n",i,dl_config_pdu->pdu_type);/////////////*********added
handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu);
eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++;
//LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci);
......@@ -735,8 +746,9 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
(dlsch_pdu_rel8->transport_blocks>0),
"dlsch_pdu_rel8->transport_blocks = %d not in [1,2]\n",
dlsch_pdu_rel8->transport_blocks);
if (1)//sdu != NULL)
if (sdu != NULL)
{
LOG_I(PHY,"NFAPI: executing handle_nfapi_dlsch_pdu()\n");/////////////*********added
handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu);
}
else
......
......@@ -359,7 +359,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
&eNB->dlsch_turbo_encoding_wakeup_stats1,
&eNB->dlsch_interleaving_stats);
stop_meas(&eNB->dlsch_encoding_stats);
//////////////////////////////////////////////////*******************************************
if(eNB->dlsch_encoding_stats.diff_now>500*3000 && opp_enabled == 1)
{
print_meas_now(&eNB->dlsch_encoding_stats,"total coding",stderr);
......@@ -471,6 +470,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
LOG_I(PHY,"phy_procedures_eNB_TX %d.%d UL %d.%d harq_pid == %d \n", frame, subframe, ul_frame, ul_subframe, harq_pid);////////////********added
if (eNB->ulsch[i]) {
ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid];
......@@ -536,6 +536,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
// Now scan UE specific DLSCH
LTE_eNB_DLSCH_t *dlsch0,*dlsch1;
LOG_I(PHY,"phy_procedures_eNB_TX before dlsch0 %d.%d UL %d.%d harq_pid == %d \n", frame, subframe, ul_frame, ul_subframe, harq_pid);////////////********added
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
{
dlsch0 = eNB->dlsch[(uint8_t)UE_id][0];
......
......@@ -153,6 +153,7 @@ static void *feptx_thread(void *param) {
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
if (oai_exit) break;
//stop_meas(&ru->ofdm_mod_wakeup_stats);
feptx0(ru,1);
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"feptx thread")<0) break;
......@@ -461,6 +462,7 @@ static void *fep_thread(void *param) {
while (!oai_exit) {
if (wait_on_condition(&proc->mutex_fep,&proc->cond_fep,&proc->instance_cnt_fep,"fep thread")<0) break;
if (oai_exit) break;
//stop_meas(&ru->ofdm_demod_wakeup_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX1, 1 );
fep0(ru,0);
......@@ -510,6 +512,33 @@ void init_fep_thread(RU_t *ru,pthread_attr_t *attr_fep) {
}
extern void kill_fep_thread(RU_t *ru)
{
RU_proc_t *proc = &ru->proc;
pthread_mutex_lock( &proc->mutex_fep );
proc->instance_cnt_fep = 0;
pthread_cond_signal(&proc->cond_fep);
pthread_mutex_unlock( &proc->mutex_fep );
LOG_D(PHY, "Joining pthread_fep\n");
pthread_join(proc->pthread_fep, NULL);
pthread_mutex_destroy( &proc->mutex_fep );
pthread_cond_destroy( &proc->cond_fep );
}
extern void kill_feptx_thread(RU_t *ru)
{
RU_proc_t *proc = &ru->proc;
pthread_mutex_lock( &proc->mutex_feptx );
proc->instance_cnt_feptx = 0;
pthread_cond_signal(&proc->cond_feptx);
pthread_mutex_unlock( &proc->mutex_feptx );
LOG_D(PHY, "Joining pthread_feptx\n");
pthread_join(proc->pthread_feptx, NULL);
pthread_mutex_destroy( &proc->mutex_feptx );
pthread_cond_destroy( &proc->cond_feptx );
}
void ru_fep_full_2thread(RU_t *ru) {
RU_proc_t *proc = &ru->proc;
......
......@@ -687,43 +687,4 @@ typedef enum {
#define CONFIG_STRING_MACRLC_CONFIG "macrlc_config"
/* MACRLC configuration parameters names */
#define CONFIG_STRING_MACRLC_CC "num_cc"
#define CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE "tr_n_preference"
#define CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME "local_n_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS "local_n_address"
#define CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS "remote_n_address"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTC "local_n_portc"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTC "remote_n_portc"
#define CONFIG_STRING_MACRLC_LOCAL_N_PORTD "local_n_portd"
#define CONFIG_STRING_MACRLC_REMOTE_N_PORTD "remote_n_portd"
#define CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE "tr_s_preference"
#define CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME "local_s_if_name"
#define CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS "local_s_address"
#define CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS "remote_s_address"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTC "local_s_portc"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTC "remote_s_portc"
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
#define CONFIG_STRING_MACRLC_PHY_TEST_MODE "phy_test_mode"
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
#define MACRLC_LOCAL_N_ADDRESS_IDX 3
#define MACRLC_REMOTE_N_ADDRESS_IDX 4
#define MACRLC_LOCAL_N_PORTC_IDX 5
#define MACRLC_REMOTE_N_PORTC_IDX 6
#define MACRLC_LOCAL_N_PORTD_IDX 7
#define MACRLC_REMOTE_N_PORTD_IDX 8
#define MACRLC_TRANSPORT_S_PREFERENCE_IDX 9
#define MACRLC_LOCAL_S_IF_NAME_IDX 10
#define MACRLC_LOCAL_S_ADDRESS_IDX 11
#define MACRLC_REMOTE_S_ADDRESS_IDX 12
#define MACRLC_LOCAL_S_PORTC_IDX 13
#define MACRLC_REMOTE_S_PORTC_IDX 14
#define MACRLC_LOCAL_S_PORTD_IDX 15
#define MACRLC_REMOTE_S_PORTD_IDX 16
#define MACRLC_PHY_TEST_IDX 17
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -666,6 +666,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frameP,
}
else{
schedule_ulsch_phy_test(module_idP,frameP,subframeP);
LOG_I(MAC,"frameP = %d .subframeP = %d\n", frameP, subframeP);/////////////*********added
schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status);
}
......
......@@ -67,13 +67,13 @@ schedule_ue_spec_phy_test(
uint16_t TBS;
uint16_t nb_rb;
unsigned char harq_pid = subframeP%5;
unsigned char harq_pid = (frameP*10+subframeP)%8;
uint16_t rnti = 0x1235;
uint32_t rb_alloc = 0x1FFFFFFF;
int32_t tpc = 1;
int32_t mcs = 28;
int32_t cqi = 15;
int32_t ndi = subframeP/5;
int32_t ndi = 1;//(frameP*10+subframeP)/8;
int32_t dai = 0;
eNB_MAC_INST *eNB = RC.mac[module_idP];
......@@ -92,10 +92,9 @@ schedule_ue_spec_phy_test(
continue;
nb_rb = conv_nprb(0,rb_alloc,N_RB_DL);
//printf("////////////////////////////////////*************************nb_rb = %d\n",nb_rb);
TBS = get_TBS_DL(mcs,nb_rb);
LOG_D(PHY,"schedule_ue_spec_phy_test: subframe %d/%d: nb_rb=%d, TBS=%d, mcs=%d (rb_alloc=%x, N_RB_DL=%d)\n",frameP,subframeP,nb_rb,TBS,mcs,rb_alloc,N_RB_DL);
LOG_I(MAC,"schedule_ue_spec_phy_test: subframe %d/%d: nb_rb=%d, TBS=%d, mcs=%d harq_pid=%d (rb_alloc=%x, N_RB_DL=%d) pdu_number = %d \n", frameP, subframeP, nb_rb, TBS, mcs, harq_pid, rb_alloc, N_RB_DL, dl_req->number_pdu);////////////********change into LOG_I
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void*)dl_config_pdu,0,sizeof(nfapi_dl_config_request_pdu_t));
......@@ -125,7 +124,7 @@ schedule_ue_spec_phy_test(
LOG_D(MAC,"[eNB %d] Initial transmission CC_id %d : harq_pid %d, dai %d, mcs %d\n",
module_idP,CC_id,harq_pid,dai,mcs);
} else {
LOG_D(MAC,"[eNB %d] Initial transmission CC_id %d : harq_pid %d, mcs %d\n",
LOG_I(MAC,"[eNB %d] Initial transmission CC_id %d : harq_pid %d, mcs %d\n",
module_idP,CC_id,harq_pid,mcs);
}
......@@ -136,6 +135,9 @@ schedule_ue_spec_phy_test(
//ue_sched_ctl->round[CC_id][harq_pid] = 0;
dl_req->number_dci++;
dl_req->number_pdu++;
LOG_I(MAC,"phy-test DL number of dci = %d pdu = %d \n", dl_req->number_dci, dl_req->number_pdu);////////////********added
eNB->DL_req[CC_id].sfn_sf = frameP<<4 | subframeP;
//eNB->DL_req[CC_id].header.message_id = NFAPI_DL_CONFIG_REQUEST;
// Toggle NDI for next time
/*
......@@ -149,7 +151,7 @@ schedule_ue_spec_phy_test(
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated!=NULL,"physicalConfigDedicated is NULL\n");
AssertFatal(UE_list->UE_template[CC_id][UE_id].physicalConfigDedicated->pdsch_ConfigDedicated!=NULL,"physicalConfigDedicated->pdsch_ConfigDedicated is NULL\n");
*/
LOG_I(MAC,"pdu_index = %d \n", eNB->pdu_index[CC_id]);////////////********added
fill_nfapi_dlsch_config(eNB,
......@@ -196,7 +198,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
int UE_id = 0;
uint8_t aggregation = 2;
rnti_t rnti = 0x1235;
uint8_t mcs = 0;
uint8_t mcs = 20;
uint8_t harq_pid = 0;
uint32_t cqi_req = 0,cshift,ndi,tpc = 1;
int32_t normalized_rx_power;
......@@ -235,7 +237,7 @@ void schedule_ulsch_phy_test(module_id_t module_idP,frame_t frameP,sub_frame_t s
UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
harq_pid = subframe2harqpid(&cc[CC_id],sched_frame,sched_subframe);
LOG_D(MAC,"Scheduling for frame %d, subframe %d => harq_pid %d\n",sched_frame,sched_subframe,harq_pid);
LOG_I(MAC,"Scheduling for frame %d, subframe %d => harq_pid %d\n",sched_frame,sched_subframe,harq_pid);
RC.eNB[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->TBS_UL[harq_pid];
......
......@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208";
mobile_network_code = "93";
mobile_network_code = "92";
tr_s_preference = "local_mac"
......
......@@ -217,14 +217,14 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
wakeup_prach_eNB_br(eNB,NULL,proc->frame_rx,proc->subframe_rx);
#endif
}
LOG_I(PHY,"eNB_uespec_RX proc RX %d.%d TX %d.%d \n", proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);/////////////*********added
// UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) {
phy_procedures_eNB_uespec_RX(eNB, proc, no_relay );
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 1 );
if(get_nprocs() >= 8){
if(!eNB->single_thread_flag && get_nprocs() >= 8){
if(wait_on_condition(&proc[1].mutex_rxtx,&proc[1].cond_rxtx,&proc[1].pipe_ready,"wakeup_tx")<0) {
LOG_E(PHY,"Frame %d, subframe %d: TX1 not ready\n",proc[1].frame_rx,proc[1].subframe_rx);
return(-1);
......@@ -238,6 +238,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
eNB->UL_INFO.subframe = proc->subframe_rx;
eNB->UL_INFO.module_id = eNB->Mod_id;
eNB->UL_INFO.CC_id = eNB->CC_id;
LOG_I(PHY,"UL_INFO %d.%d \n", eNB->UL_INFO.frame, eNB->UL_INFO.subframe);/////////////*********added
eNB->if_inst->UL_indication(&eNB->UL_INFO);
......@@ -245,7 +246,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER , 0 );
if(oai_exit) return(-1);
if(get_nprocs() <= 4){
if(eNB->single_thread_flag || get_nprocs() <= 4){
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
}
......@@ -327,6 +328,7 @@ static void* tx_thread(void* param) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_ENB,proc->frame_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX1_ENB,proc->frame_rx);
LOG_I(PHY,"tx thread proc RX %d.%d TX %d.%d \n", proc->frame_rx, proc->subframe_rx, proc->frame_tx, proc->subframe_tx);/////////////*********added
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
......@@ -408,7 +410,7 @@ static void* eNB_thread_rxtx( void* param ) {
}
pthread_mutex_unlock( &proc->mutex_rxtx );
if(get_nprocs() >= 8) wakeup_tx(eNB,eNB->proc.ru_proc);
else
else if(get_nprocs() > 4)
{
phy_procedures_eNB_TX(eNB, proc, no_relay, NULL, 1);
wakeup_txfh(proc,eNB->proc.ru_proc);
......@@ -565,7 +567,7 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
eNB_proc_t *proc=&eNB->proc;
RU_proc_t *ru_proc=&ru->proc;
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];//*proc_rxtx=&proc->proc_rxtx[proc->frame_rx&1];
eNB_rxtx_proc_t *proc_rxtx0=&proc->proc_rxtx[0];
//eNB_rxtx_proc_t *proc_rxtx1=&proc->proc_rxtx[1];
......@@ -956,21 +958,18 @@ void init_eNB_proc(int inst) {
// attr_td = &proc->attr_td;
// attr_te = &proc->attr_te;
#endif
//////////////////////////////////////need to modified////////////////*****
if(get_nprocs() > 2 && codingw)
{
init_te_thread(eNB);
init_td_thread(eNB);
}
//////////////////////////////////////need to modified////////////////*****
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
LOG_I(PHY,"eNB->single_thread_flag:%d\n", eNB->single_thread_flag);
if (eNB->single_thread_flag==0) {
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, proc );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, tx_thread, proc);
}
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
#ifdef Rel14
......
......@@ -945,7 +945,6 @@ void wakeup_slaves(RU_proc_t *proc) {
wait.tv_nsec=5000000L;
for (i=0;i<proc->num_slaves;i++) {
//printf("////////////////////calling for slave thrads\n");////////////////////////********
RU_proc_t *slave_proc = proc->slave_proc[i];
// wake up slave FH thread
// lock the FH mutex and make sure the thread is ready
......@@ -1197,9 +1196,14 @@ void wakeup_eNBs(RU_t *ru) {
{
LOG_D(PHY,"ru->wakeup_rxtx:%p\n", ru->wakeup_rxtx);
eNB_list[i]->proc.ru_proc = &ru->proc;
if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
if(eNB_list[i]->single_thread_flag){
char string[20];
sprintf(string,"Incoming RU %d",ru->idx);
ru->eNB_top(eNB_list[0],ru->proc.frame_rx,ru->proc.subframe_rx,string,ru);
}
else if (ru->wakeup_rxtx!=0 && ru->wakeup_rxtx(eNB_list[i],ru) < 0)
{
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
}
}
}
......@@ -1623,7 +1627,8 @@ static void* ru_thread( void* param ) {
ru->do_prach,
is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx),
proc->frame_rx,proc->subframe_rx);
*/
*/
if (oai_exit) break;
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
wakeup_prach_ru(ru);
}
......@@ -1666,10 +1671,12 @@ static void* ru_thread( void* param ) {
printf( "Exiting ru_thread \n");
if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0)
LOG_E(HW,"Could not stop the RF device\n");
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
if (!emulate_rf){
if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0)
LOG_E(HW,"Could not stop the RF device\n");
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
}
}
ru_thread_status = 0;
......@@ -1778,6 +1785,8 @@ extern void feptx_ofdm_2thread(RU_t *ru);
extern void feptx_prec(RU_t *ru);
extern void init_fep_thread(RU_t *ru,pthread_attr_t *attr);
extern void init_feptx_thread(RU_t *ru,pthread_attr_t *attr);
extern void kill_fep_thread(RU_t *ru);
extern void kill_feptx_thread(RU_t *ru);
void init_RU_proc(RU_t *ru) {
......@@ -1901,6 +1910,17 @@ void kill_RU_proc(int inst)
RU_t *ru = RC.ru[inst];
RU_proc_t *proc = &ru->proc;
if (get_nprocs() > 2 && fepw) {
if (ru->feprx) {
LOG_D(PHY, "killing FEP thread\n");
kill_fep_thread(ru);
}
if (ru->feptx_ofdm){
LOG_D(PHY, "killing FEP TX thread\n");
kill_feptx_thread(ru);
}
}
pthread_mutex_lock(&proc->mutex_FH);
proc->instance_cnt_FH = 0;
pthread_cond_signal(&proc->cond_FH);
......@@ -1962,28 +1982,6 @@ void kill_RU_proc(int inst)
pthread_join(proc->pthread_asynch_rxtx, NULL);
}
}
if (get_nprocs() > 2 && fepw) {
if (ru->feprx) {
pthread_mutex_lock(&proc->mutex_fep);
proc->instance_cnt_fep = 0;
pthread_mutex_unlock(&proc->mutex_fep);
pthread_cond_signal(&proc->cond_fep);
LOG_D(PHY, "Joining pthread_fep\n");
pthread_join(proc->pthread_fep, NULL);
pthread_mutex_destroy(&proc->mutex_fep);
pthread_cond_destroy(&proc->cond_fep);
}
if (ru->feptx_ofdm) {
pthread_mutex_lock(&proc->mutex_feptx);
proc->instance_cnt_feptx = 0;
pthread_mutex_unlock(&proc->mutex_feptx);
pthread_cond_signal(&proc->cond_feptx);
LOG_D(PHY, "Joining pthread_feptx\n");
pthread_join(proc->pthread_feptx, NULL);
pthread_mutex_destroy(&proc->mutex_feptx);
pthread_cond_destroy(&proc->cond_feptx);
}
}
if (opp_enabled) {
LOG_D(PHY, "Joining ru_stats_thread\n");
pthread_join(ru->ru_stats_thread, NULL);
......@@ -2348,7 +2346,7 @@ void set_function_spec_param(RU_t *ru)
} // switch on interface type
}
extern void RCconfig_RU(void);
//extern void RCconfig_RU(void);
void init_RU(char *rf_config_file) {
......
......@@ -136,7 +136,7 @@ static clock_source_t clock_source = internal;
static int wait_for_sync = 0;
unsigned int mmapped_dma=0;
int single_thread_flag=1;
int single_thread_flag = 0;
static int8_t threequarter_fs=0;
......
......@@ -152,7 +152,7 @@ extern int16_t dlsch_demod_shift;
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:0, TYPE_INT, 0}, \
{"threadIQ", NULL, 0, iptr:&(threads.iq), defintval:1, TYPE_INT, 0}, \
{"threadOneSubframe", NULL, 0, iptr:&(threads.one), defintval:1, TYPE_INT, 0}, \
{"threadTwoSubframe", NULL, 0, iptr:&(threads.two), defintval:1, TYPE_INT, 0}, \
......
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