Commit 96f18a06 authored by matzakos's avatar matzakos

Added functions copying nfapi requests to UE_mac_inst + Substituted calls to...

Added functions copying nfapi requests to UE_mac_inst + Substituted calls to phy_procedures_ue rx/tx with phy_stub functions triggering MAC layer Tx/Rx procedures at UE MAC. Changes within UE_thread_rxn_txnp4
parent 66ae679d
...@@ -1280,14 +1280,14 @@ typedef struct { ...@@ -1280,14 +1280,14 @@ typedef struct {
/// Pointers to LogicalChannelConfig indexed by LogicalChannelIdentity. Note NULL means LCHAN is inactive. /// Pointers to LogicalChannelConfig indexed by LogicalChannelIdentity. Note NULL means LCHAN is inactive.
LogicalChannelConfig_t *logicalChannelConfig[MAX_NUM_LCID]; LogicalChannelConfig_t *logicalChannelConfig[MAX_NUM_LCID];
/// Panos: Pointer to IF_Module_UE instance of the UE /*/// Panos: Pointer to IF_Module_UE instance of the UE
IF_Module_UE_t *if_inst_ue; IF_Module_UE_t *if_inst_ue;
/// Panos: UE_MAC interface: Config request structure. /// Panos: UE_MAC interface: Config request structure.
UE_PHY_Config_t UE_config; UE_PHY_Config_t UE_config;
/// Panos: UE_MAC interface: UL Config Request Structure /// Panos: UE_MAC interface: UL Config Request Structure
UE_MAC_ul_config_request_t UL_req_ue[MAX_NUM_CCs]; UE_MAC_ul_config_request_t UL_req_ue[MAX_NUM_CCs];
/// Panos: UE_MAC interface: UL Transmission request structure. /// Panos: UE_MAC interface: UL Transmission request structure.
UE_MAC_tx_request_t UL_TX_req[MAX_NUM_CCs]; UE_MAC_tx_request_t UL_TX_req[MAX_NUM_CCs];*/
/// Scheduling Information /// Scheduling Information
...@@ -1391,6 +1391,15 @@ typedef struct { ...@@ -1391,6 +1391,15 @@ typedef struct {
/// Panos: Phy_stub mode: Boolean variable to distinguish whether a Msg3 or a regular ULSCH data pdu should be generated /// Panos: Phy_stub mode: Boolean variable to distinguish whether a Msg3 or a regular ULSCH data pdu should be generated
/// after the reception of NFAPI_UL_CONFIG_ULSCH_PDU_TYPE. /// after the reception of NFAPI_UL_CONFIG_ULSCH_PDU_TYPE.
uint8_t first_ULSCH_Tx; uint8_t first_ULSCH_Tx;
/// Panos: Pointers to config_request types. Used from nfapi callback functions.
nfapi_dl_config_request_t* dl_config_req;
nfapi_ul_config_request_t* ul_config_req;
nfapi_hi_dci0_request_t* hi_dci0_req;
nfapi_tx_request_t* tx_req;
} UE_MAC_INST; } UE_MAC_INST;
/*! \brief ID of the neighboring cells used for HO*/ /*! \brief ID of the neighboring cells used for HO*/
typedef struct { typedef struct {
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
//#include "openair1/PHY/defs.h" //#include "openair1/PHY/defs.h"
//#include "openair2/PHY_INTERFACE/IF_Module.h" //#include "openair2/PHY_INTERFACE/IF_Module.h"
//#include "openair1/PHY/extern.h" //#include "openair1/PHY/extern.h"
#include "LAYER2/MAC/extern.h" #include "openair2/LAYER2/MAC/extern.h"
//#include "LAYER2/MAC/proto.h" #include "openair2/LAYER2/MAC/defs.h"
#include "openair2/LAYER2/MAC/vars.h" #include "openair2/LAYER2/MAC/proto.h"
//#include "openair2/LAYER2/MAC/vars.h"
#include "openair1/SCHED/defs.h"
//#include "common/ran_context.h" //#include "common/ran_context.h"
#include "openair2/PHY_INTERFACE/phy_stub_UE.h" #include "openair2/PHY_INTERFACE/phy_stub_UE.h"
//#include "nfapi_pnf_interface.h" //#include "nfapi_pnf_interface.h"
...@@ -636,7 +638,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, ...@@ -636,7 +638,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
int ul_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req) int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req)
{ {
LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n", LOG_D(PHY,"[PNF] UL_CONFIG_REQ %s() sfn_sf:%d pdu:%d rach_prach_frequency_resources:%d srs_present:%u\n",
__FUNCTION__, __FUNCTION__,
...@@ -725,8 +727,12 @@ int ul_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_ ...@@ -725,8 +727,12 @@ int ul_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_
return 0; return 0;
} }
int tx_req_UE_MAC1( int k) {
return 0;
}
int tx_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req) int tx_req_UE_MAC(nfapi_tx_request_t* req)
{ {
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf); uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf); uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
...@@ -756,7 +762,7 @@ int tx_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req) ...@@ -756,7 +762,7 @@ int tx_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
} }
int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req) int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
{ {
int sfn = NFAPI_SFNSF2SFN(req->sfn_sf); int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
...@@ -856,7 +862,7 @@ int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_ ...@@ -856,7 +862,7 @@ int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_
else else
{ {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type); //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type);
} }
} }
...@@ -868,7 +874,7 @@ int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_ ...@@ -868,7 +874,7 @@ int dl_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_
int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req) int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req)
{ {
LOG_D(PHY,"[UE-PHY_STUB] hi dci0 request sfn_sf:%d number_of_dci:%d number_of_hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi); LOG_D(PHY,"[UE-PHY_STUB] hi dci0 request sfn_sf:%d number_of_dci:%d number_of_hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi);
...@@ -910,6 +916,32 @@ int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* r ...@@ -910,6 +916,32 @@ int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* r
return 0; return 0;
} }
// The following set of memcpy functions should be getting called as callback functions from
// pnf_p7_subframe_ind.
void memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].dl_config_req = req;
}
void memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].ul_config_req = req;
}
void memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].tx_req = req;
}
void memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req)
{
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].hi_dci0_req = req;
}
/*void handle_nfapi_UE_Rx(uint8_t Mod_id, Sched_Rsp_t *Sched_INFO, int eNB_id){ /*void handle_nfapi_UE_Rx(uint8_t Mod_id, Sched_Rsp_t *Sched_INFO, int eNB_id){
......
...@@ -71,16 +71,32 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, int frame, int subframe, UL_IND ...@@ -71,16 +71,32 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id, int frame, int subframe, UL_IND
/*uint8_t tdd_mapping_mode, /*uint8_t tdd_mapping_mode,
uint16_t tdd_multiplexing_mask*/); uint16_t tdd_multiplexing_mask*/);
int ul_config_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req); int ul_config_req_UE_MAC(nfapi_ul_config_request_t* req);
void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id, void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
nfapi_ul_config_request_pdu_t *ul_config_pdu, nfapi_ul_config_request_pdu_t *ul_config_pdu,
uint16_t frame,uint8_t subframe,uint8_t srs_present); uint16_t frame,uint8_t subframe,uint8_t srs_present);
int tx_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req); int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req);
int tx_req_UE_MAC(nfapi_tx_request_t* req);
int hi_dci0_req_UE_MAC(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req);
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req);
// The following set of memcpy functions should be getting called as callback functions from
// pnf_p7_subframe_ind.
void memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req);
void memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req);
void memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req);
void memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req);
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
#include "RRC/LITE/extern.h" #include "RRC/LITE/extern.h"
#endif #endif
#include "PHY_INTERFACE/phy_stub_UE.h"
#include "PHY_INTERFACE/extern.h" #include "PHY_INTERFACE/extern.h"
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
...@@ -46,6 +47,8 @@ ...@@ -46,6 +47,8 @@
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/proto.h" #include "LAYER2/MAC/proto.h"
//#include "openair2/PHY_INTERFACE/phy_stub_UE.h"
#include "UTIL/LOG/log_extern.h" #include "UTIL/LOG/log_extern.h"
#include "UTIL/OTG/otg_tx.h" #include "UTIL/OTG/otg_tx.h"
...@@ -71,6 +74,7 @@ typedef enum { ...@@ -71,6 +74,7 @@ typedef enum {
void init_UE_threads(int); void init_UE_threads(int);
void *UE_thread(void *arg); void *UE_thread(void *arg);
void init_UE(int nb_inst,int,int); void init_UE(int nb_inst,int,int);
//extern int tx_req_UE_MAC1();
int32_t **rxdata; int32_t **rxdata;
int32_t **txdata; int32_t **txdata;
...@@ -560,6 +564,7 @@ static void *UE_thread_synch(void *arg) ...@@ -560,6 +564,7 @@ static void *UE_thread_synch(void *arg)
*/ */
static void *UE_thread_rxn_txnp4(void *arg) { static void *UE_thread_rxn_txnp4(void *arg) {
module_id_t Mod_id = 0;
static __thread int UE_thread_rxtx_retval; static __thread int UE_thread_rxtx_retval;
struct rx_tx_thread_data *rtd = arg; struct rx_tx_thread_data *rtd = arg;
UE_rxtx_proc_t *proc = rtd->proc; UE_rxtx_proc_t *proc = rtd->proc;
...@@ -633,8 +638,18 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -633,8 +638,18 @@ static void *UE_thread_rxn_txnp4(void *arg) {
#ifdef UE_SLOT_PARALLELISATION #ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); phy_procedures_slot_parallelization_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else #else
// Panos: Substitute with call to handle_nfapi_UE_Rx(Sched_Resp). // Panos: Substitute call to phy_procedures Rx with call to phy_stub functions in order to trigger
phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); // UE Rx procedures directly at the MAC layer, based on the received nfapi requests from the vnf (eNB).
// Hardcode Mod_id for now. Will be changed later.
if(UE_mac_inst[Mod_id].tx_req)
tx_req_UE_MAC(UE_mac_inst[Mod_id].tx_req);
if(UE_mac_inst[Mod_id].dl_config_req)
dl_config_req_UE_MAC(UE_mac_inst[Mod_id].dl_config_req);
if(UE_mac_inst[Mod_id].hi_dci0_req)
hi_dci0_req_UE_MAC(UE_mac_inst[Mod_id].hi_dci0_req);
//phy_procedures_UE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#endif #endif
} }
...@@ -680,8 +695,14 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -680,8 +695,14 @@ static void *UE_thread_rxn_txnp4(void *arg) {
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) ) (UE->frame_parms.frame_type == FDD) )
if (UE->mode != loop_through_memory){ if (UE->mode != loop_through_memory){
// Panos: Substitute with call to generate_nfapi_UL_indications and then send_nfapi_UL_indications() // Panos: Substitute call to phy_procedures Tx with call to phy_stub functions in order to trigger
phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay); // UE Tx procedures directly at the MAC layer, based on the received ul_config requests from the vnf (eNB).
// Generate UL_indications which corresponf to UL traffic.
if(UE_mac_inst[Mod_id].ul_config_req){
ul_config_req_UE_MAC(UE_mac_inst[Mod_id].ul_config_req);
UL_indication(UL_INFO);
}
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
} }
......
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