Commit 6768c7da authored by Nick Ho's avatar Nick Ho

modify the rxtx approach code compiled

parent abad0f86
......@@ -44,6 +44,7 @@ typedef enum
DCIFormatN1,
DCIFormatN1_RA,
DCIFormatN1_RAR,
DCIFormatN2,
DCIFormatN2_Ind,
DCIFormatN2_Pag,
}DCI_format_NB_t;
......
......@@ -68,8 +68,7 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
uint16_t rnti,
DCI_format_NB_t dci_format,
uint8_t UE_id,
uint8_t aggregation,
uint8_t Num_dci
uint8_t aggregation
)
{
......@@ -120,7 +119,7 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN0_t *)ULSCH_DCI_NB)->ndi =ndi;
((DCIN0_t *)ULSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci = Num_dci;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,ULSCH_DCI_NB,rnti,sizeof(DCIN0_t),aggregation,sizeof_DCIN0_t,DCIFormatN0);
......@@ -147,8 +146,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
DCI_format_NB_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation,
uint8_t Num_dci
uint8_t aggregation
)
{
......@@ -221,7 +219,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN1_RAR_t *)DLSCH_DCI_NB)->HARQackRes =HARQackRes;
((DCIN1_RAR_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci = Num_dci;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_RAR_t),aggregation,sizeof_DCIN1_RAR_t,DCIFormatN1_RAR);
......@@ -255,7 +253,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN1_t *)DLSCH_DCI_NB)->HARQackRes =HARQackRes;
((DCIN1_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci = Num_dci;
//eNB->DCI_pdu->Num_dci = Num_dci;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1);
......@@ -272,7 +270,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN2_Ind_t *)DLSCH_DCI_NB)->directIndInf =directIndInf;
((DCIN2_Ind_t *)DLSCH_DCI_NB)->resInfoBits =resInfoBits;
eNB->DCI_pdu->Num_dci = Num_dci;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind);
......@@ -294,7 +292,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
((DCIN2_Pag_t *)DLSCH_DCI_NB)->RepNum =RepNum;
((DCIN2_Pag_t *)DLSCH_DCI_NB)->DCIRep =DCIRep;
eNB->DCI_pdu->Num_dci = Num_dci;
eNB->DCI_pdu->Num_dci++;
NB_add_dci(eNB->DCI_pdu,DLSCH_DCI_NB,rnti,sizeof(DCIN2_Pag_t),aggregation,sizeof_DCIN2_Pag_t,DCIFormatN2_Pag);
......
......@@ -99,8 +99,7 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
uint16_t rnti,
DCI_format_NB_t dci_format,
uint8_t UE_id,
uint8_t aggregation,
uint8_t Num_dci
uint8_t aggregation
);
/*Use the DL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
......@@ -111,8 +110,7 @@ int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
DCI_format_NB_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation,
uint8_t Num_dci
uint8_t aggregation
);
......
#include "../SCHED/IF_Module_L1_primitives_nb_iot.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/vars.h"
// do the schedule response and trigger the TX
void schedule_response(Sched_Rsp_t *Sched_INFO)
{
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][Sched_INFO->CC_id];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
int UE_id = 0;
int i;
module_id_t Mod_id = Sched_INFO->module_id;
uint8_t CC_id = Sched_INFO->CC_id;
nfapi_dl_config_request_body_t *DL_req = &Sched_INFO->DL_req;
nfapi_ul_config_request_t *UL_req = &Sched_INFO->UL_req;
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &Sched_INFO->HI_DCI0_req;
frame_t frame = Sched_INFO->frame;
sub_frame_t subframe = Sched_INFO->subframe;
uint8_t number_dl_pdu = DL_req->number_pdu;
uint8_t number_ul_pdu = UL_req->ul_config_request_body.number_of_pdus;
uint8_t number_ul_dci = HI_DCI0_req->number_of_dci;
uint8_t number_pdsch_rnti = DL_req->number_pdsch_rnti; // for the moment not used
// at most 2 pdus in the case of NPDCCH
nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_ul_config_request_pdu_t *ul_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
for (i=0;i<number_dl_pdu;i++)
{
dl_config_pdu = &DL_req->dl_config_pdu_list[i];
switch (dl_config_pdu->pdu_type)
{
case NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE:
NB_generate_eNB_dlsch_params(eNB,proc,dl_config_pdu);
break;
case NFAPI_DL_CONFIG_NBCH_PDU_TYPE:
// Do nothing for the moment
break;
case NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE:
// Do the distinction between SIB (type 0) and other downlink data (type 1)
//handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu,Sched_INFO->sdu[i]);
break;
}
}
for (i=0;i<number_ul_dci;i++)
{
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[i];
switch (hi_dci0_pdu->pdu_type)
{
case NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE:
NB_generate_eNB_ulsch_params(eNB,proc,hi_dci0_pdu);
break;
}
}
NB_phy_procedures_eNB_TX(eNB,proc,NULL);
//to be integrated in the scheduling procedure of L1
void schedule_response(Sched_Rsp_t *Sched_INFO){
//todo
}
void PHY_config_req(PHY_Config_t* config_INFO){
......
......@@ -18,10 +18,10 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, UL
void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
/*Generate the ulsch params and do the mapping for the FAPI style parameters to OAI, and then do the packing*/
void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,Sched_Rsp_t *Sched_Rsp,const int UE_id);
void NB_generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu);
/*Generate the dlsch params and do the mapping for the FAPI style parameters to OAI, and then do the packing*/
void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,Sched_Rsp_t *Sched_Rsp,const int UE_id);
void NB_generate_eNB_dlsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
/*Process all the scheduling result from MAC and also common signals.*/
void NB_phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int do_meas);
......
......@@ -127,10 +127,10 @@ typedef struct{
/*Uplink data part*/
/*indication of the uplink data*/
nfapi_ul_config_nulsch_pdu NULSCH;
/*Uplink data PDU*/
nfapi_rx_indication_body_t RX_NPUSCH;
/*indication of the harq feedback*/
nfapi_nb_harq_indication_t nb_harq_ind;
/*indication of the uplink data PDU*/
nfapi_rx_indication_body_t RX_NPUSCH;
/*crc_indication*/
nfapi_crc_indication_body_t crc_ind;
......@@ -138,67 +138,28 @@ typedef struct{
// Downlink subframe P7
typedef struct{
/*Indicate the MIB PDU*/
nfapi_dl_config_nbch_pdu_rel13_t nbch;
/*MIB PDU*/
nfapi_tx_request_pdu_t MIB_pdu;
}npbch_t;
typedef struct{
/*indicate the NPDSCH PDU*/
nfapi_dl_config_ndlsch_pdu_rel13_t ndlsch;
/*NPDSCH PDU*/
nfapi_tx_request_pdu_t NPDSCH_pdu;
}npdsch_t;
typedef struct{
// sinces FAPI spec didn't explain the format for the DCI clearly
DCI_format_NB_t DCI_Format;
/*DL DCI, it contains the DCI list and the other useful information*/
nfapi_dl_config_request_body_t DL_DCI;
/*UL DCI*/
nfapi_hi_dci0_request_body_t UL_DCI;
}npdcch_t;
typedef struct{
nfapi_ul_config_request_pdu_t ulsch_pdu;
}nulsch_t;
typedef struct{
// these structures contains both instruction and PDUs itself
npdcch_t *NB_DCI;
npdsch_t *NB_DLSCH;
npbch_t *NB_BCH;
nulsch_t *NB_UL_config;
}NB_DL_t;
typedef struct{
/*Start at the common part*/
//Module ID
module_id_t module_idP;
module_id_t module_id;
//CC ID
int CC_id;
//frame
frame_t frameP;
frame_t frame;
//subframe
sub_frame_t subframeP;
sub_frame_t subframe;
NB_DL_t NB_DL;
/// nFAPI DL Config Request
nfapi_dl_config_request_body_t *DL_req;
/// nFAPI UL Config Request
nfapi_ul_config_request_t *UL_req;
/// nFAPI HI_DCI Request
nfapi_hi_dci0_request_body_t *HI_DCI0_req;
/// Pointers to DL SDUs
uint8_t **sdu;
}Sched_Rsp_t;
......
......@@ -608,17 +608,10 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
if(if_inst->UL_indication) if_inst->UL_indication(UL_INFO);
// *****************************************
// TX processing for subframe n+4
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
// (may be relaxed in the future for performance reasons)
// *****************************************
//if (wait_CCs(proc)<0) return(-1);
// phy_proceduers_eNB_TX will be triggered at schedule response
if (oai_exit) return(-1);
NB_phy_procedures_eNB_TX(eNB,proc,NULL);
if (release_thread(&proc->mutex_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) return(-1);
......
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