diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h index d169177d6b182eeae05d4290c1fa88e3248cd1c7..08d451f5fbdb24980ed94f7a918f53cd5e2abafb 100644 --- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h +++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h @@ -25,7 +25,7 @@ extern "C" { #include "nfapi_interface.h" #include "debug.h" #include <openair2/PHY_INTERFACE/IF_Module.h> - +#include <openair1/PHY/defs_eNB.h> #include <sys/types.h> /*! This enum is used to describe the states of the pnf diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h index 9f3c092b63b6067c94e5eb330213c38bfc92c708..a3c45256e89ef98b198262c764e07a011785b34e 100644 --- a/openair1/PHY/defs_eNB.h +++ b/openair1/PHY/defs_eNB.h @@ -216,6 +216,58 @@ typedef struct { int ret; } td_params; +/// Context data structure for RX/TX portion of subframe processing +typedef struct { + /// Component Carrier index + uint8_t CC_id; + /// timestamp transmitted to HW + openair0_timestamp timestamp_tx; + openair0_timestamp timestamp_rx; + /// subframe to act upon for transmission + int subframe_tx; + /// subframe to act upon for reception + int subframe_rx; + /// frame to act upon for transmission + int frame_tx; + /// frame to act upon for reception + int frame_rx; + int frame_prach; + int subframe_prach; + int frame_prach_br; + int subframe_prach_br; + /// \brief Instance count for RXn-TXnp4 processing thread. + /// \internal This variable is protected by \ref mutex_rxtx. + int instance_cnt; + /// pthread structure for RXn-TXnp4 processing thread + pthread_t pthread; + /// pthread attributes for RXn-TXnp4 processing thread + pthread_attr_t attr; + /// condition variable for tx processing thread + pthread_cond_t cond; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex; + /// scheduling parameters for RXn-TXnp4 thread + struct sched_param sched_param_rxtx; + + /// \internal This variable is protected by \ref mutex_RUs. + int instance_cnt_RUs; + /// condition variable for tx processing thread + pthread_cond_t cond_RUs; + /// mutex for RXn-TXnp4 processing thread + pthread_mutex_t mutex_RUs; + tpool_t *threadPool; + int nbEncode; + int nbDecode; + notifiedFIFO_t *respEncode; + notifiedFIFO_t *respDecode; + pthread_mutex_t mutex_emulateRF; + int instance_cnt_emulateRF; + pthread_t pthread_emulateRF; + pthread_attr_t attr_emulateRF; + pthread_cond_t cond_emulateRF; + int first_rx; +} L1_rxtx_proc_t; + typedef struct { struct PHY_VARS_eNB_s *eNB; LTE_eNB_DLSCH_t *dlsch; diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c index 272ac4cb99017c189f20eea5b335c64c16789f3b..ecfec02193d498d9f167bb1e5278a46f3c5eafee 100644 --- a/openair1/SCHED/fapi_l1.c +++ b/openair1/SCHED/fapi_l1.c @@ -749,7 +749,8 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, } } -void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) { +void schedule_response(Sched_Rsp_t *Sched_INFO, void *arg) { + L1_rxtx_proc_t *proc = (L1_rxtx_proc_t *)arg; PHY_VARS_eNB *eNB; // copy data from L2 interface into L1 structures module_id_t Mod_id = Sched_INFO->module_id; diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h index a122e36782924fcc8536d056b49c89e2516ea036..b8f0ae1dd89a96f8b5b6b6d688c0852b57f806ce 100644 --- a/openair1/SCHED/fapi_l1.h +++ b/openair1/SCHED/fapi_l1.h @@ -80,4 +80,4 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe); -void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc); +void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc); diff --git a/openair1/SCHED/sched_common.h b/openair1/SCHED/sched_common.h index f3e43d516ece342271860bad060b5669da6bb01b..c9fc3386865b6931fc7fdbb98f694f61d078806f 100644 --- a/openair1/SCHED/sched_common.h +++ b/openair1/SCHED/sched_common.h @@ -311,7 +311,7 @@ void get_cqipmiri_params(PHY_VARS_UE *ue,uint8_t eNB_id); int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id, uint8_t eNB_index); -void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc); +void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc); LTE_eNB_UE_stats* get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti); diff --git a/openair1/SCHED/sched_eNB.h b/openair1/SCHED/sched_eNB.h index f04bec2e5c45f691d75fb0e39aeaae07c34d409f..de987b0ac7eece4820e24f208798954a658d7572 100644 --- a/openair1/SCHED/sched_eNB.h +++ b/openair1/SCHED/sched_eNB.h @@ -193,7 +193,7 @@ int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); -void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc); +void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc); LTE_eNB_UE_stats *get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti); diff --git a/openair2/PHY_INTERFACE/IF_Module.c b/openair2/PHY_INTERFACE/IF_Module.c index 32780b070683e5d4f1043d1021c296d3ed8dc622..fea23207dbb897a21c5544660c21ee4c035591db 100644 --- a/openair2/PHY_INTERFACE/IF_Module.c +++ b/openair2/PHY_INTERFACE/IF_Module.c @@ -687,7 +687,7 @@ static void dump_dl(Sched_Rsp_t *d) { /* debug utility functions end */ /****************************************************************************/ -void UL_indication(UL_IND_t *UL_info, L1_rxtx_proc_t *proc) { +void UL_indication(UL_IND_t *UL_info, void *proc) { AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); #ifdef DUMP_FAPI dump_ul(UL_info); diff --git a/openair2/PHY_INTERFACE/IF_Module.h b/openair2/PHY_INTERFACE/IF_Module.h index 632617eb93292929e926db6297d8986343e62140..096979c4fd195595ac9e6076d3d06d686cfa5745 100644 --- a/openair2/PHY_INTERFACE/IF_Module.h +++ b/openair2/PHY_INTERFACE/IF_Module.h @@ -134,64 +134,13 @@ typedef struct { uint8_t Mod_id; int CC_id; nfapi_config_request_t *cfg; -}PHY_Config_t; +} PHY_Config_t; #include <targets/ARCH/COMMON/common_lib.h> -/// Context data structure for RX/TX portion of subframe processing -typedef struct { - /// Component Carrier index - uint8_t CC_id; - /// timestamp transmitted to HW - openair0_timestamp timestamp_tx; - openair0_timestamp timestamp_rx; - /// subframe to act upon for transmission - int subframe_tx; - /// subframe to act upon for reception - int subframe_rx; - /// frame to act upon for transmission - int frame_tx; - /// frame to act upon for reception - int frame_rx; - int frame_prach; - int subframe_prach; - int frame_prach_br; - int subframe_prach_br; - /// \brief Instance count for RXn-TXnp4 processing thread. - /// \internal This variable is protected by \ref mutex_rxtx. - int instance_cnt; - /// pthread structure for RXn-TXnp4 processing thread - pthread_t pthread; - /// pthread attributes for RXn-TXnp4 processing thread - pthread_attr_t attr; - /// condition variable for tx processing thread - pthread_cond_t cond; - /// mutex for RXn-TXnp4 processing thread - pthread_mutex_t mutex; - /// scheduling parameters for RXn-TXnp4 thread - struct sched_param sched_param_rxtx; - - /// \internal This variable is protected by \ref mutex_RUs. - int instance_cnt_RUs; - /// condition variable for tx processing thread - pthread_cond_t cond_RUs; - /// mutex for RXn-TXnp4 processing thread - pthread_mutex_t mutex_RUs; - tpool_t *threadPool; - int nbEncode; - int nbDecode; - notifiedFIFO_t *respEncode; - notifiedFIFO_t *respDecode; - pthread_mutex_t mutex_emulateRF; - int instance_cnt_emulateRF; - pthread_t pthread_emulateRF; - pthread_attr_t attr_emulateRF; - pthread_cond_t cond_emulateRF; - int first_rx; -} L1_rxtx_proc_t; typedef struct IF_Module_s{ //define the function pointer - void (*UL_indication)(UL_IND_t *UL_INFO, L1_rxtx_proc_t *proc); - void (*schedule_response)(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc); + void (*UL_indication)(UL_IND_t *UL_INFO, void *proc); + void (*schedule_response)(Sched_Rsp_t *Sched_INFO, void *proc); void (*PHY_config_req)(PHY_Config_t* config_INFO); void (*PHY_config_update_sib2_req)(PHY_Config_t* config_INFO); @@ -208,7 +157,7 @@ void IF_Module_kill(int Mod_id); /*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler) */ -void UL_indication(UL_IND_t *UL_INFO, L1_rxtx_proc_t *proc); +void UL_indication(UL_IND_t *UL_INFO, void *proc); /*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/ void Schedule_Response(Sched_Rsp_t *Sched_INFO); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 1f28e5a7c8066bd7c7aba3403a7e9d5eb67fb315..c6d3d2c026f6b006266058952b329375dec7e329 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -265,7 +265,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB, eNB->UL_INFO.subframe = proc->subframe_rx; eNB->UL_INFO.module_id = eNB->Mod_id; eNB->UL_INFO.CC_id = eNB->CC_id; - eNB->if_inst->UL_indication(&eNB->UL_INFO, proc); + eNB->if_inst->UL_indication(&eNB->UL_INFO, (void*)proc); AssertFatal((ret= pthread_mutex_unlock(&eNB->UL_INFO_mutex))==0,"error unlocking UL_INFO_mutex, return %d\n",ret); /* this conflict resolution may be totally wrong, to be tested */ /* CONFLICT RESOLUTION: BEGIN */