Commit e7f91a38 authored by wujing's avatar wujing

fix issues about pre_scd thread

parent e2b99f3f
...@@ -568,6 +568,14 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP, ...@@ -568,6 +568,14 @@ generate_Msg2(module_id_t module_idP, int CC_idP, frame_t frameP,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1;
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ;
// Rel10 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc->sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
// Rel13 fields
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF = 0;
dl_req->number_pdu++; dl_req->number_pdu++;
mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP; mac->DL_req[CC_idP].sfn_sf = frameP<<4 | subframeP;
......
...@@ -2105,10 +2105,12 @@ void schedule_PCH(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP) ...@@ -2105,10 +2105,12 @@ void schedule_PCH(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
// Rel10 fields // Rel10 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(10, 0, 0))
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL10_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3;
#endif #endif
// Rel13 fields // Rel13 fields
#if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(13, 0, 0))
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.tl.tag = NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL13_TAG;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0; // regular UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 0; // regular UE
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not BR
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF;
......
...@@ -1763,6 +1763,7 @@ static void* ru_thread( void* param ) { ...@@ -1763,6 +1763,7 @@ static void* ru_thread( void* param ) {
wakeup_slaves(proc); wakeup_slaves(proc);
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
if (nfapi_mode == 0){
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use; new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use; dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX); memcpy(&pre_scd_eNB_UE_stats,&RC.mac[ru->eNB_list[0]->Mod_id]->UE_list.eNB_UE_stats, sizeof(eNB_UE_STATS)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
...@@ -1788,6 +1789,7 @@ static void* ru_thread( void* param ) { ...@@ -1788,6 +1789,7 @@ static void* ru_thread( void* param ) {
LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n"); LOG_E( PHY, "[eNB] error unlocking mutex_pre_scd mutex for eNB pre scd\n");
exit_fun("error unlocking mutex_pre_scd"); exit_fun("error unlocking mutex_pre_scd");
} }
}
#endif #endif
// wakeup all eNB processes waiting for this RU // wakeup all eNB processes waiting for this RU
...@@ -1939,7 +1941,7 @@ void* pre_scd_thread( void* param ){ ...@@ -1939,7 +1941,7 @@ void* pre_scd_thread( void* param ){
break; break;
} }
pthread_mutex_lock(&ru->proc.mutex_pre_scd ); pthread_mutex_lock(&ru->proc.mutex_pre_scd );
if (ru->proc.instance_pre_scd < 0) { while(ru->proc.instance_pre_scd < 0) {
pthread_cond_wait(&ru->proc.cond_pre_scd, &ru->proc.mutex_pre_scd); pthread_cond_wait(&ru->proc.cond_pre_scd, &ru->proc.mutex_pre_scd);
} }
pthread_mutex_unlock(&ru->proc.mutex_pre_scd); pthread_mutex_unlock(&ru->proc.mutex_pre_scd);
...@@ -2196,11 +2198,13 @@ void init_RU_proc(RU_t *ru) { ...@@ -2196,11 +2198,13 @@ void init_RU_proc(RU_t *ru) {
pthread_create( &proc->pthread_FH, attr_FH, ru_thread, (void*)ru ); pthread_create( &proc->pthread_FH, attr_FH, ru_thread, (void*)ru );
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
if (nfapi_mode == 0){
proc->instance_pre_scd = -1; proc->instance_pre_scd = -1;
pthread_mutex_init( &proc->mutex_pre_scd, NULL); pthread_mutex_init( &proc->mutex_pre_scd, NULL);
pthread_cond_init( &proc->cond_pre_scd, NULL); pthread_cond_init( &proc->cond_pre_scd, NULL);
pthread_create(&proc->pthread_pre_scd, NULL, pre_scd_thread, (void*)ru); pthread_create(&proc->pthread_pre_scd, NULL, pre_scd_thread, (void*)ru);
pthread_setname_np(proc->pthread_pre_scd, "pre_scd_thread"); pthread_setname_np(proc->pthread_pre_scd, "pre_scd_thread");
}
#endif #endif
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
...@@ -2252,6 +2256,7 @@ void kill_RU_proc(RU_t *ru) ...@@ -2252,6 +2256,7 @@ void kill_RU_proc(RU_t *ru)
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
if((nfapi_mode == 2) || (nfapi_mode == 0)){
pthread_mutex_lock(&proc->mutex_pre_scd); pthread_mutex_lock(&proc->mutex_pre_scd);
ru->proc.instance_pre_scd = 0; ru->proc.instance_pre_scd = 0;
pthread_cond_signal(&proc->cond_pre_scd); pthread_cond_signal(&proc->cond_pre_scd);
...@@ -2259,6 +2264,7 @@ void kill_RU_proc(RU_t *ru) ...@@ -2259,6 +2264,7 @@ void kill_RU_proc(RU_t *ru)
pthread_join(proc->pthread_pre_scd, NULL); pthread_join(proc->pthread_pre_scd, NULL);
pthread_mutex_destroy(&proc->mutex_pre_scd); pthread_mutex_destroy(&proc->mutex_pre_scd);
pthread_cond_destroy(&proc->cond_pre_scd); pthread_cond_destroy(&proc->cond_pre_scd);
}
#endif #endif
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
pthread_mutex_lock(&proc->mutex_phy_tx); pthread_mutex_lock(&proc->mutex_phy_tx);
...@@ -2909,7 +2915,7 @@ void init_ru_vnf(void) { ...@@ -2909,7 +2915,7 @@ void init_ru_vnf(void) {
} // for ru_id } // for ru_id
RC.ru_mask = 0;
// sleep(1); // sleep(1);
LOG_D(HW,"[lte-softmodem.c] RU threads created\n"); LOG_D(HW,"[lte-softmodem.c] RU threads created\n");
......
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