Commit f7236598 authored by Nick Ho's avatar Nick Ho

Correct UL_INFO as a pointer

parent c6b11be0
......@@ -4,7 +4,7 @@
//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
}
......
......@@ -7,7 +7,7 @@
#define __IF_MODULE_L1_PRIMITIVES_NB_IOT_H__
/*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
* Trigger the phy_config_xxx functions using parameters from the shared PHY_Config structure
......
......@@ -8,7 +8,7 @@
#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
/*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*/
void NB_common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
......
......@@ -42,8 +42,6 @@
#include <asm/page.h>
#ifdef RTAI_ENABLED
#include <rtai.h>
//#include <rtai_posix.h>
......@@ -78,4 +76,5 @@ extern fifo_dump_emos_eNB emos_dump_eNB;
#endif
*/
#endif /*__SCHED_EXTERN_H__ */
......@@ -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
......@@ -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;
/*NB-IoT IF module Common setting*/
UL_IND_t UL_INFO;
UL_INFO.module_id = eNB->Mod_id;
UL_INFO.CC_id = eNB->CC_id;
UL_INFO.frame = frame;
UL_INFO.subframe = subframe;
UL_INFO->module_id = eNB->Mod_id;
UL_INFO->CC_id = eNB->CC_id;
UL_INFO->frame = frame;
UL_INFO->subframe = 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)
if (eNB->mac_enabled == 1)
{
//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.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)->data= NULL;
(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.number_of_pdus++;
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 1;
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)->data= NULL;
(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.number_of_pdus++;
}
}
}
......@@ -344,13 +342,13 @@ void NB_phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if (eNB->mac_enabled)
{
// 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.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)->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_ue_information.harq_pid = harq_pid;
UL_INFO.RX_NPUSCH.number_of_pdus++;
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0;
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)->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_ue_information.harq_pid = harq_pid;
UL_INFO->RX_NPUSCH.number_of_pdus++;
}
/* 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)
if (eNB->mac_enabled==1)
{
// 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.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)->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_ue_information.harq_pid = harq_pid;
UL_INFO.RX_NPUSCH.number_of_pdus++;
(UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag= 0;
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)->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_ue_information.harq_pid = harq_pid;
UL_INFO->RX_NPUSCH.number_of_pdus++;
} // mac_enabled==1
} // Msg3_flag == 0
......@@ -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
/*Exact not here, but use to debug*/
if_inst->UL_indication(UL_INFO);
}
#undef DEBUG_PHY_PROC
......
#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;
/*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,
UL_INFO.CC_id,
UL_INFO.frame,
(UL_INFO.NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
NB_initiate_ra_proc(UL_INFO->module_id,
UL_INFO->CC_id,
UL_INFO->frame,
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
//timing_offset = Timing_advance * 16
(UL_INFO.NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16,
UL_INFO.subframe
(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16,
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*/
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*/
NB_rx_sdu(UL_INFO.module_id,
UL_INFO.CC_id,
UL_INFO.frame,
UL_INFO.subframe,
(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)->rx_indication_rel8.length,
(UL_INFO.RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid
NB_rx_sdu(UL_INFO->module_id,
UL_INFO->CC_id,
UL_INFO->frame,
UL_INFO->subframe,
(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)->rx_indication_rel8.length,
(UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid
);
......
......@@ -8,6 +8,6 @@
/*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
......@@ -207,8 +207,8 @@ typedef struct{
It should be allocated at the main () in lte-softmodem.c*/
typedef struct IF_Module_s{
//define the function pointer
void (*UL_indication)(UL_IND_t UL_INFO);
void (*schedule_response)(Sched_Rsp_t Sched_INFO);
void (*UL_indication)(UL_IND_t *UL_INFO);
void (*schedule_response)(Sched_Rsp_t *Sched_INFO);
void (*PHY_config_req)(PHY_Config_t* config_INFO);
}IF_Module_t;
......
......@@ -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) {
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);
......@@ -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
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
......
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