Commit f7236598 authored by Nick Ho's avatar Nick Ho

Correct UL_INFO as a pointer

parent c6b11be0
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
//to be integrated in the scheduling procedure of L1 //to be integrated in the scheduling procedure of L1
void schedule_response(Sched_Rsp_t Sched_INFO){ void schedule_response(Sched_Rsp_t *Sched_INFO){
//todo //todo
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#define __IF_MODULE_L1_PRIMITIVES_NB_IOT_H__ #define __IF_MODULE_L1_PRIMITIVES_NB_IOT_H__
/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/ /*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void schedule_response(Sched_Rsp_t Sched_INFO); void schedule_response(Sched_Rsp_t *Sched_INFO);
/*Interface for PHY Configuration /*Interface for PHY Configuration
* Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure * Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h" #include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
/*Processing the ue-specific resources for uplink in NB-IoT*/ /*Processing the ue-specific resources for uplink in NB-IoT*/
void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, UL_IND_t *UL_INFO);
/* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler,this generates NRS/NPSS/NSSS*/ /* For NB-IoT, we put NPBCH in later part, since it would be scheduled by MAC scheduler,this generates NRS/NPSS/NSSS*/
void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
......
...@@ -42,8 +42,6 @@ ...@@ -42,8 +42,6 @@
#include <asm/page.h> #include <asm/page.h>
#ifdef RTAI_ENABLED #ifdef RTAI_ENABLED
#include <rtai.h> #include <rtai.h>
//#include <rtai_posix.h> //#include <rtai_posix.h>
...@@ -78,4 +76,5 @@ extern fifo_dump_emos_eNB emos_dump_eNB; ...@@ -78,4 +76,5 @@ extern fifo_dump_emos_eNB emos_dump_eNB;
#endif #endif
*/ */
#endif /*__SCHED_EXTERN_H__ */ #endif /*__SCHED_EXTERN_H__ */
...@@ -126,7 +126,7 @@ void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -126,7 +126,7 @@ void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} }
void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,UL_IND_t *UL_INFO)
{ {
//RX processing for ue-specific resources (i //RX processing for ue-specific resources (i
...@@ -141,13 +141,11 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -141,13 +141,11 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
/*NB-IoT IF module Common setting*/ /*NB-IoT IF module Common setting*/
UL_IND_t UL_INFO;
UL_INFO.module_id = eNB->Mod_id; UL_INFO->module_id = eNB->Mod_id;
UL_INFO.CC_id = eNB->CC_id; UL_INFO->CC_id = eNB->CC_id;
UL_INFO.frame = frame; UL_INFO->frame = frame;
UL_INFO.subframe = subframe; UL_INFO->subframe = subframe;
T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe)); T(T_ENB_PHY_UL_TICK, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe));
...@@ -302,13 +300,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -302,13 +300,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if (eNB->mac_enabled == 1) if (eNB->mac_enabled == 1)
{ {
//instead rx_sdu to report The Uplink data not received successfully to MAC //instead rx_sdu to report The Uplink data not received successfully to MAC
(UL_INFO.crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 1; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 1;
UL_INFO.crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->data= NULL; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data= NULL;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = 0; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = 0;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO.RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} }
} }
} }
...@@ -344,13 +342,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -344,13 +342,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if (eNB->mac_enabled) if (eNB->mac_enabled)
{ {
// store successful MSG3 in UL_Info instead rx_sdu // store successful MSG3 in UL_Info instead rx_sdu
(UL_INFO.crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0;
UL_INFO.crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->data = eNB->ulsch[i]->harq_processes[harq_pid]->b; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->ulsch[i]->harq_processes[harq_pid]->b;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO.RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} }
/* Need check if this needed in NB-IoT /* Need check if this needed in NB-IoT
...@@ -404,13 +402,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -404,13 +402,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if (eNB->mac_enabled==1) if (eNB->mac_enabled==1)
{ {
// store successful Uplink data in UL_Info instead rx_sdu // store successful Uplink data in UL_Info instead rx_sdu
(UL_INFO.crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0; (UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0;
UL_INFO.crc_ind.number_of_crcs++; UL_INFO->crc_ind.number_of_crcs++;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti= eNB->ulsch[i]->rnti;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->data = eNB->ulsch[i]->harq_processes[harq_pid]->b; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data = eNB->ulsch[i]->harq_processes[harq_pid]->b;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length = eNB->ulsch[i]->harq_processes[harq_pid]->TBS>>3;
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid; (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid = harq_pid;
UL_INFO.RX_NPUSCH.number_of_pdus++; UL_INFO->RX_NPUSCH.number_of_pdus++;
} // mac_enabled==1 } // mac_enabled==1
} // Msg3_flag == 0 } // Msg3_flag == 0
...@@ -443,11 +441,6 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -443,11 +441,6 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} // loop i=0 ... NUMBER_OF_UE_MAX-1 } // loop i=0 ... NUMBER_OF_UE_MAX-1
/*Exact not here, but use to debug*/
if_inst->UL_indication(UL_INFO);
} }
#undef DEBUG_PHY_PROC #undef DEBUG_PHY_PROC
......
#include "IF_Module_L2_primitives_nb_iot.h" #include "IF_Module_L2_primitives_nb_iot.h"
void UL_indication(UL_IND_t UL_INFO) // Sched_INFO as a input for the scheduler
void UL_indication(UL_IND_t *UL_INFO)
{ {
int i=0; int i=0;
/*If there is a preamble, do the initiate RA procedure*/ /*If there is a preamble, do the initiate RA procedure*/
if(UL_INFO.NRACH.number_of_initial_scs_detected>0) if(UL_INFO->NRACH.number_of_initial_scs_detected>0)
{ {
for(i=0;i<UL_INFO.NRACH.number_of_initial_scs_detected;i++) for(i=0;i<UL_INFO->NRACH.number_of_initial_scs_detected;i++)
{ {
NB_initiate_ra_proc(UL_INFO.module_id, NB_initiate_ra_proc(UL_INFO->module_id,
UL_INFO.CC_id, UL_INFO->CC_id,
UL_INFO.frame, UL_INFO->frame,
(UL_INFO.NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc, (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
//timing_offset = Timing_advance * 16 //timing_offset = Timing_advance * 16
(UL_INFO.NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16, (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16,
UL_INFO.subframe UL_INFO->subframe
); );
} }
} }
if(UL_INFO.RX_NPUSCH.number_of_pdus>0) if(UL_INFO->RX_NPUSCH.number_of_pdus>0)
{ {
/*If there is a Uplink SDU (even MSG3, NAK) need to send to MAC*/ /*If there is a Uplink SDU (even MSG3, NAK) need to send to MAC*/
for(i=0;i<UL_INFO.RX_NPUSCH.number_of_pdus;i++) for(i=0;i<UL_INFO->RX_NPUSCH.number_of_pdus;i++)
{ {
/*For MSG3, Normal Uplink Data, NAK*/ /*For MSG3, Normal Uplink Data, NAK*/
NB_rx_sdu(UL_INFO.module_id, NB_rx_sdu(UL_INFO->module_id,
UL_INFO.CC_id, UL_INFO->CC_id,
UL_INFO.frame, UL_INFO->frame,
UL_INFO.subframe, UL_INFO->subframe,
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti, (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti,
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->data, (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data,
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length, (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length,
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid
); );
......
...@@ -8,6 +8,6 @@ ...@@ -8,6 +8,6 @@
/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler) /*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler)
*/ */
void UL_indication(UL_IND_t UL_INFO); void UL_indication(UL_IND_t *UL_INFO);
#endif #endif
...@@ -207,8 +207,8 @@ typedef struct{ ...@@ -207,8 +207,8 @@ typedef struct{
It should be allocated at the main () in lte-softmodem.c*/ It should be allocated at the main () in lte-softmodem.c*/
typedef struct IF_Module_s{ typedef struct IF_Module_s{
//define the function pointer //define the function pointer
void (*UL_indication)(UL_IND_t UL_INFO); void (*UL_indication)(UL_IND_t *UL_INFO);
void (*schedule_response)(Sched_Rsp_t Sched_INFO); void (*schedule_response)(Sched_Rsp_t *Sched_INFO);
void (*PHY_config_req)(PHY_Config_t* config_INFO); void (*PHY_config_req)(PHY_Config_t* config_INFO);
}IF_Module_t; }IF_Module_t;
......
...@@ -580,7 +580,11 @@ int wait_CCs(eNB_rxtx_proc_t *proc) { ...@@ -580,7 +580,11 @@ int wait_CCs(eNB_rxtx_proc_t *proc) {
*/ */
static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) { static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
UL_IND_t UL_INFO; //not here but temp UL_IND_t *UL_INFO;
Sched_Rsp_t *Sched_Rsp;
UL_INFO = (UL_IND_t*) malloc(sizeof(UL_IND_t));
Sched_Rsp = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t));
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
...@@ -593,7 +597,7 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_ ...@@ -593,7 +597,7 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
NB_phy_procedures_eNB_uespec_RX(eNB,proc); NB_phy_procedures_eNB_uespec_RX(eNB,proc,UL_INFO);
// After stored the Upink information, process it and made it into FAPI style, also provide a tick to the scheduler // After stored the Upink information, process it and made it into FAPI style, also provide a tick to the scheduler
......
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