Commit 3cced60a authored by matzakos's avatar matzakos

Connected new callback functions at nfapi_pnf for phy_stub mode + Intorducing...

Connected new callback functions at nfapi_pnf for phy_stub mode + Intorducing new functions initializing UE variables and threads specific to phy_stub mode, instead of extending the existing ones + Direct connection of the timer_thread with UE_phy_stub_thread_rxn_txnp4.
parent 911ed228
......@@ -9,6 +9,7 @@
#include "nfapi.h"
#include "nfapi_pnf.h"
#include "common/ran_context.h"
#include "openair2/PHY_INTERFACE/phy_stub_UE.h"
//#include "openair1/PHY/vars.h"
extern RAN_CONTEXT_t RC;
......@@ -1338,10 +1339,18 @@ int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi
p7_config->timing_info_mode_aperiodic = 1;
}
if (nfapi_mode==3) {
p7_config->dl_config_req = &memcpy_dl_config_req;
p7_config->ul_config_req = &memcpy_ul_config_req;
p7_config->hi_dci0_req = &memcpy_hi_dci0_req;
p7_config->tx_req = &memcpy_tx_req;
}
else {
p7_config->dl_config_req = &pnf_phy_dl_config_req;
p7_config->ul_config_req = &pnf_phy_ul_config_req;
p7_config->hi_dci0_req = &pnf_phy_hi_dci0_req;
p7_config->tx_req = &pnf_phy_tx_req;
}
p7_config->lbt_dl_config_req = &pnf_phy_lbt_dl_config_req;
memset(&dummy_dl_config_req, 0, sizeof(dummy_dl_config_req));
......
......@@ -137,6 +137,16 @@ void ue_init_mac(module_id_t module_idP)
UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[i] = 0;
}
if(nfapi_mode == 3) {
pthread_mutex_init(&UE_mac_inst[module_idP].UL_INFO_mutex,NULL);
UE_mac_inst[module_idP].UE_mode[0] = PRACH;
UE_mac_inst[module_idP].first_ULSCH_Tx =0;
UE_mac_inst[module_idP].dl_config_req = NULL;
UE_mac_inst[module_idP].ul_config_req = NULL;
UE_mac_inst[module_idP].hi_dci0_req = NULL;
UE_mac_inst[module_idP].tx_req = NULL;
}
#ifdef CBA
for (i=0; i <NUM_MAX_CBA_GROUP; i++) {
......
......@@ -489,7 +489,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint16_t rnti = ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.rnti;
uint8_t access_mode=SCHEDULED_ACCESS;
if(buflen>0){
if(UE_mac_inst[Mod_id].first_ULSCH_Tx){ // Msg3 case
if(UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ // Msg3 case
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti);
Msg3_transmitted(Mod_id, 0, frame, 0);
......@@ -514,7 +514,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint16_t rnti = ul_config_pdu->ulsch_harq_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
uint8_t access_mode=SCHEDULED_ACCESS;
if(buflen>0){
if(UE_mac_inst[Mod_id].first_ULSCH_Tx){ // Msg3 case
if(UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ // Msg3 case
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti);
Msg3_transmitted(Mod_id, 0, frame, 0);
......@@ -542,7 +542,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint16_t rnti = ul_config_pdu->ulsch_cqi_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
uint8_t access_mode=SCHEDULED_ACCESS;
if(buflen>0){
if(UE_mac_inst[Mod_id].first_ULSCH_Tx){ // Msg3 case
if(UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ // Msg3 case
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti);
Msg3_transmitted(Mod_id, 0, frame, 0);
......@@ -569,7 +569,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
uint16_t rnti = ul_config_pdu->ulsch_cqi_harq_ri_pdu.ulsch_pdu.ulsch_pdu_rel8.rnti;
uint8_t access_mode=SCHEDULED_ACCESS;
if(buflen>0){
if(UE_mac_inst[Mod_id].first_ULSCH_Tx){ // Msg3 case
if(UE_mac_inst[Mod_id].first_ULSCH_Tx == 1){ // Msg3 case
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0);
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti);
Msg3_transmitted(Mod_id, 0, frame, 0);
......@@ -921,28 +921,32 @@ 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)
int 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;
return 0;
}
void memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
int 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;
return 0;
}
void memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
int 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;
return 0;
}
void memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req)
int 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;
return 0;
}
......
......@@ -87,16 +87,16 @@ 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);
int 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);
int 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);
int 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);
int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req);
......
This diff is collapsed.
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