Commit 9d7568fc authored by Daniel0326's avatar Daniel0326

fix phy_procedure_lte_eNb_NB_IoT.c error

parent 36ae3457
...@@ -233,7 +233,7 @@ typedef struct { // LTE_eNB_DLSCH_t ...@@ -233,7 +233,7 @@ typedef struct { // LTE_eNB_DLSCH_t
/// First-round error threshold for fine-grain rate adaptation /// First-round error threshold for fine-grain rate adaptation
uint8_t error_threshold; uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH /// Pointers to 8 HARQ processes for the DLSCH
NB_IoT_DL_eNB_HARQ_t harq_process; NB_IoT_DL_eNB_HARQ_t harq_processes[8];
/// circular list of free harq PIDs (the oldest come first) /// circular list of free harq PIDs (the oldest come first)
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE) /// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
int harq_pid_freelist[10]; int harq_pid_freelist[10];
...@@ -451,7 +451,7 @@ typedef struct { ...@@ -451,7 +451,7 @@ typedef struct {
/// HARQ-ACKs /// HARQ-ACKs
harq_status_NB_IoT_t harq_ack; harq_status_NB_IoT_t harq_ack;
/// Pointers to up to 8 HARQ processes /// Pointers to up to 8 HARQ processes
NB_IoT_DL_UE_HARQ_t *harq_process; NB_IoT_DL_UE_HARQ_t *harq_processes[8];
/// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17 /// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17
uint8_t Mdlharq; uint8_t Mdlharq;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17) /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
...@@ -546,7 +546,7 @@ typedef struct { ...@@ -546,7 +546,7 @@ typedef struct {
///in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required/// ///in NB-IoT there is only 1 HARQ process for each UE therefore no pid is required///
/// The only HARQ process for the DLSCH /// The only HARQ process for the DLSCH
NB_IoT_DL_eNB_HARQ_t *harq_process; NB_IoT_DL_eNB_HARQ_t *harq_processes[8];
// NB_IoT_DL_eNB_SIB1_t harq_process_sib1; // NB_IoT_DL_eNB_SIB1_t harq_process_sib1;
...@@ -743,7 +743,7 @@ typedef struct { ...@@ -743,7 +743,7 @@ typedef struct {
typedef struct { typedef struct {
/// Pointers to the HARQ processes for the NULSCH /// Pointers to the HARQ processes for the NULSCH
NB_IoT_UL_eNB_HARQ_t *harq_process; NB_IoT_UL_eNB_HARQ_t *harq_processes[8];
/// Maximum number of HARQ rounds /// Maximum number of HARQ rounds
uint8_t Mlimit; uint8_t Mlimit;
/// Value 0 = npush format 1 (data) value 1 = npusch format 2 (ACK/NAK) /// Value 0 = npush format 1 (data) value 1 = npusch format 2 (ACK/NAK)
......
...@@ -308,6 +308,9 @@ typedef struct { ...@@ -308,6 +308,9 @@ typedef struct {
uint32_t frame_dscr_msg5; uint32_t frame_dscr_msg5;
uint32_t subframe_dscr_msg5; uint32_t subframe_dscr_msg5;
uint32_t frame_dscr_msg3; //phy_procedures_lte_eNb_NB_IoT.c
uint32_t subframe_dscr_msg3; //phy_procedures_lte_eNb_NB_IoT.c
} eNB_rxtx_proc_NB_IoT_t; } eNB_rxtx_proc_NB_IoT_t;
/* /*
typedef struct { typedef struct {
...@@ -815,6 +818,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s { ...@@ -815,6 +818,9 @@ typedef struct PHY_VARS_eNB_NB_IoT_s {
NB_IoT_eNB_NDLSCH_t *ndlsch_RAR; NB_IoT_eNB_NDLSCH_t *ndlsch_RAR;
NB_IoT_eNB_NPDCCH_t *npdcch_DCI; NB_IoT_eNB_NPDCCH_t *npdcch_DCI;
uint8_t msg3_pdu[6]; //phy_procedures_lte_eNb_NB_IoT.c
} PHY_VARS_eNB_NB_IoT; } PHY_VARS_eNB_NB_IoT;
......
...@@ -185,7 +185,7 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id) ...@@ -185,7 +185,7 @@ uint8_t is_SR_TXOp(PHY_VARS_UE *phy_vars_ue,UE_rxtx_proc_t *proc,uint8_t eNB_id)
@param UE_id ID of UE which may be issuing the SR @param UE_id ID of UE which may be issuing the SR
@returns 1 if TXOp is active. @returns 1 if TXOp is active.
*/ */
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,uint8_t UE_id); //uint8_t is_SR_subframe(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc,uint8_t UE_id);
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n /*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
@param frame_parms Pointer to DL frame parameters @param frame_parms Pointer to DL frame parameters
......
...@@ -186,7 +186,7 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index); ...@@ -186,7 +186,7 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
@param UE_id ID of UE which may be issuing the SR @param UE_id ID of UE which may be issuing the SR
@returns 1 if TXOp is active. @returns 1 if TXOp is active.
*/ */
uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,L1_rxtx_proc_t *proc,uint8_t UE_id); //uint8_t is_SR_subframe(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc,uint8_t UE_id);
int8_t find_ue_dlsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int8_t find_ue_dlsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB); int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
......
...@@ -35,7 +35,7 @@ void generate_eNB_ulsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_ ...@@ -35,7 +35,7 @@ void generate_eNB_ulsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_
void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu); void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu);
/*Process all the scheduling result from MAC and also common signals.*/ /*Process all the scheduling result from MAC and also common signals.*/
void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc,int do_meas); void phy_procedures_eNB_TX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc,relaying_type_t r_type,PHY_VARS_RN_NB_IoT *rn,int do_meas,int do_pdcch_flag);
int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB_NB_IoT *eNB); int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB_NB_IoT *eNB);
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
//#define DEBUG_PHY_PROC (Already defined in cmake) //#define DEBUG_PHY_PROC (Already defined in cmake)
//#define DEBUG_ULSCH //#define DEBUG_ULSCH
//#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern_NB_IoT.h"
#include "LAYER2/MAC/defs.h" #include "LAYER2/MAC/defs.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
...@@ -74,8 +74,16 @@ ...@@ -74,8 +74,16 @@
#include "PHY/extern_NB_IoT.h" #include "PHY/extern_NB_IoT.h"
#if defined(FLEXRAN_AGENT_SB_IF)
//Agent-related headers
#include "ENB_APP/flexran_agent_extern.h"
#include "ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.h"
#include "LAYER2/MAC/flexran_agent_mac_proto.h"
#endif
extern eNB_MAC_INST_NB_IoT *eNB_mac_inst; // For NB-IoT branch
extern eNB_MAC_INST *eNB_mac_inst; // For NB-IoT branch
/* /*
...@@ -842,7 +850,7 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_ ...@@ -842,7 +850,7 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_
LOG_I(PHY,"Handling the DCI for ue-spec data or MSG4!\n"); LOG_I(PHY,"Handling the DCI for ue-spec data or MSG4!\n");
// Temp: Add UE id when Msg4 trigger // Temp: Add UE id when Msg4 trigger
eNB->ndlsch[0][0]= (NB_IoT_eNB_NDLSCH_t*) malloc(sizeof(NB_IoT_eNB_NDLSCH_t)); eNB->ndlsch[0][0]= (NB_IoT_eNB_NDLSCH_t*) malloc(sizeof(NB_IoT_eNB_NDLSCH_t));
eNB->ndlsch[0][0]->harq_process = (NB_IoT_DL_eNB_HARQ_t*)malloc(sizeof(NB_IoT_DL_eNB_HARQ_t)); eNB->ndlsch[0][0]->harq_processes = (NB_IoT_DL_eNB_HARQ_t*)malloc(sizeof(NB_IoT_DL_eNB_HARQ_t));
eNB->ndlsch[0][0]->rnti=dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti; eNB->ndlsch[0][0]->rnti=dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti;
//TODO target/SIMU/USER?init_lte/init_lte_eNB we should allocate the ndlsch structures //TODO target/SIMU/USER?init_lte/init_lte_eNB we should allocate the ndlsch structures
UE_id = find_ue_NB_IoT(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti, eNB); UE_id = find_ue_NB_IoT(dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti, eNB);
...@@ -980,7 +988,7 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -980,7 +988,7 @@ void npdsch_procedures(PHY_VARS_eNB_NB_IoT *eNB,
{ {
int frame = proc->frame_tx; int frame = proc->frame_tx;
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq = ndlsch->harq_process; NB_IoT_DL_eNB_HARQ_t *ndlsch_harq = ndlsch->harq_processes;
int input_buffer_length = ndlsch_harq->TBS/8; // get in byte //the TBS is set in generate_dlsch_param int input_buffer_length = ndlsch_harq->TBS/8; // get in byte //the TBS is set in generate_dlsch_param
NB_IoT_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT; NB_IoT_DL_FRAME_PARMS *fp = &eNB->frame_parms_NB_IoT;
int G; int G;
...@@ -1294,8 +1302,8 @@ void fill_rx_indication_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t * ...@@ -1294,8 +1302,8 @@ void fill_rx_indication_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *
pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[0]; pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[0];
pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti; pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
pdu->rx_indication_rel8.length = eNB->ulsch_NB_IoT[0]->harq_process->TBS; //eNB->ulsch_NB_IoT[0]->harq_process->TBS>>3; pdu->rx_indication_rel8.length = eNB->ulsch_NB_IoT[0]->harq_processes->TBS; //eNB->ulsch_NB_IoT[0]->harq_process->TBS>>3;
pdu->data = eNB->ulsch_NB_IoT[0]->harq_process->b; pdu->data = eNB->ulsch_NB_IoT[0]->harq_processes->b;
} else { // format 2 } else { // format 2
...@@ -1356,7 +1364,7 @@ void npusch_procedures(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc) ...@@ -1356,7 +1364,7 @@ void npusch_procedures(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *proc)
NB_IoT_eNB_NULSCH_t *nulsch; NB_IoT_eNB_NULSCH_t *nulsch;
NB_IoT_UL_eNB_HARQ_t *nulsch_harq; NB_IoT_UL_eNB_HARQ_t *nulsch_harq;
nulsch = eNB->ulsch_NB_IoT[0]; nulsch = eNB->ulsch_NB_IoT[0];
nulsch_harq = nulsch->harq_process; nulsch_harq = nulsch->harq_processes;
const int rx_subframe = proc->subframe_rx; const int rx_subframe = proc->subframe_rx;
const int rx_frame = proc->frame_rx; const int rx_frame = proc->frame_rx;
...@@ -1596,7 +1604,7 @@ void common_signal_procedures (PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t * ...@@ -1596,7 +1604,7 @@ void common_signal_procedures (PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_NB_IoT_t *
//////////////////////////////////////////////////////// to uncomment for LTE, uint8_t *pbch_pdu=&eNB->pbch_pdu[0]; //////////////////////////////////////////////////////// to uncomment for LTE, uint8_t *pbch_pdu=&eNB->pbch_pdu[0];
int subframe = proc->subframe_tx; int subframe = proc->subframe_tx;
int frame = proc->frame_tx; int frame = proc->frame_tx;
RA_TEMPLATE_NB_IoT *RA_template = (RA_TEMPLATE_NB_IoT *)&eNB_mac_inst[eNB->Mod_id].common_channels[eNB->CC_id].RA_template[0]; RA_TEMPLATE_NB_IoT *RA_template = (RA_TEMPLATE_NB_IoT *)&eNB_mac_inst[eNB->Mod_id].RA_template[0];
//int With_NSSS=0; //int With_NSSS=0;
int framerx = proc->frame_rx; int framerx = proc->frame_rx;
int subframerx = proc->subframe_rx; int subframerx = proc->subframe_rx;
......
...@@ -1108,7 +1108,7 @@ typedef struct eNB_MAC_INST_s { ...@@ -1108,7 +1108,7 @@ typedef struct eNB_MAC_INST_s {
time_stats_t schedule_ra; time_stats_t schedule_ra;
/// processing time of eNB ULSCH scheduler /// processing time of eNB ULSCH scheduler
time_stats_t schedule_ulsch; time_stats_t schedule_ulsch;
/// processing time of eNB DCI generation /// processing time of eNB DCI generations
time_stats_t fill_DLSCH_dci; time_stats_t fill_DLSCH_dci;
/// processing time of eNB MAC preprocessor /// processing time of eNB MAC preprocessor
time_stats_t schedule_dlsch_preprocessor; time_stats_t schedule_dlsch_preprocessor;
...@@ -1118,7 +1118,7 @@ typedef struct eNB_MAC_INST_s { ...@@ -1118,7 +1118,7 @@ typedef struct eNB_MAC_INST_s {
time_stats_t schedule_mch; time_stats_t schedule_mch;
/// processing time of eNB ULSCH reception /// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind time_stats_t rx_ulsch_sdu; // include rlc_data_ind
} eNB_MAC_INST; } eNB_MAC_INST_nb_iot;
/* /*
* UE part * UE part
......
...@@ -53,7 +53,6 @@ extern EMULATION_VARS *Emul_vars; ...@@ -53,7 +53,6 @@ extern EMULATION_VARS *Emul_vars;
//NB-IoT--------------------------------- //NB-IoT---------------------------------
extern eNB_MAC_INST_NB_IoT *mac_inst; extern eNB_MAC_INST_NB_IoT *mac_inst;
......
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