Commit 32aa59e0 authored by Michele Paffetti's avatar Michele Paffetti

modify PHY TX procedure. still npdsch_procedure to be completed. Code compile but lots of warnings.

parents c6df27ba 6010c7fd
......@@ -1003,6 +1003,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pbch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_nb_iot.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/phich.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pcfich.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
......
......@@ -100,7 +100,7 @@ void NB_phy_config_mib_eNB(
fp->NB_IoT_RB_ID = prb_index; //XXX to be better understand how should be managed
//fp->nb_rx_antenna_ports_eNB
fp->control_region_size = control_region_size; //(assume that this value is negative if not used)
fp->eutra_NumCRS_ports = eutra_NumCRS_ports //(valid only for in-band operating mode with different PCI)
fp->eutra_NumCRS_ports = eutra_NumCRS_ports; //(valid only for in-band operating mode with different PCI)
//TODO
......
......@@ -2045,7 +2045,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
uint32_t n_rnti,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
//NB_IoT_eNB_NPDCCH_t npdcch,
int32_t **txdataF,
uint32_t subframe)
{
......@@ -2132,24 +2131,11 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
#endif
if (dci_alloc[i].firstCCE>=0) {
//encoding
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
dci_alloc[i].L,
dci_alloc[i].rnti);
//new NB-IoT
npdcch_encoding_NB_IoT(
dci_alloc[i].dci_pdu,
frame_parms,
npdcch, //see when function dci_top is called
//no frame
subframe
//rm_stats, te_stats, i_stats
);
}
}
}
......@@ -2171,9 +2157,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
dci_alloc[i].L,
dci_alloc[i].rnti);
}
else {
}
else {
}
}
}
}
......@@ -2188,31 +2174,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
//NB-IoT--------------------------
/*
* switch(npdcch_start_index)
* case 0
* G = 272
* case 1
* G = 248
* case 2
* G = 224
* case 3
* G = 200
*/
npdcch_scrambling_NB_IoT(
frame_parms,
npdcch,
//G,
//q = nf mod 2 (TS 36.211 ch 10.2.3.1) with nf = number of frame
//slot_id
);
// Now do modulation
if (frame_parms->mode1_flag==1)
......@@ -2274,18 +2235,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
}
//NB-IoT
npdcch_modulation_NB_IoT(
txdataF,
AMP,
frame_parms,
//no symbol
//npdcch0???
//RB_ID --> statically get from the higher layer (may included in the dl_frame params)
);
#ifdef DEBUG_DCI_ENCODING
printf(" PDCCH Interleaving\n");
#endif
......@@ -2294,9 +2243,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
// This is the interleaving procedure defined in 36-211, first part of Section 6.8.5
pdcch_interleaving(frame_parms,&y[0],&wbar[0],num_pdcch_symbols,mi);
//in NB-IoT the interleaving is done directly with the encoding procedure
mprime=0;
nsymb = (frame_parms->Ncp==0) ? 14:12;
re_offset = frame_parms->first_carrier_offset;
......@@ -2422,7 +2368,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
return(num_pdcch_symbols);
}
#ifdef PHY_ABSTRACTION
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t num_ue_spec_dci,
......
......@@ -53,22 +53,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
uint32_t subframe)
{
uint8_t *e_ptr,num_pdcch_symbols;
int8_t L;
uint32_t i, lprime;
uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset;
int16_t re_offset;
uint8_t mi = get_mi(frame_parms,subframe);
static uint8_t e[DCI_BITS_MAX];
static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
int32_t *y[2];
int32_t *wbar[2];
int nushiftmod3 = frame_parms->nushift%3;
int split_flag=0;
int i,L;
/*
**e_ptr : store the encoding result, and as a input to modulation
*num_pdcch_symbols : to calculate the resource allocation for pdcch
......@@ -82,18 +68,6 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci,dci_alloc,frame_parms,subframe);
wbar[0] = &wbar0[0];
wbar[1] = &wbar1[0];
y[0] = &yseq0[0];
y[1] = &yseq1[0];
// reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1;
e_ptr = e;
// generate DCIs in order of decreasing aggregation level, then common/ue spec
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization
......@@ -104,25 +78,16 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
if (dci_alloc[i].L == (uint8_t)L) {
if (dci_alloc[i].firstCCE>=0) {
//encoding
e_ptr = generate_dci0(
dci_alloc[i].dci_pdu, //we should pass the two DCI pdu (if exist)
//second pdu
//aggregation level
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
dci_alloc[i].L,
dci_alloc[i].rnti);
//new NB-IoT
npdcch_encoding_NB_IoT(
dci_alloc[i].dci_pdu,
frame_parms,
npdcch, //see when function dci_top is called
//no frame
subframe
//rm_stats, te_stats, i_stats
);
//NB-IoT encoding
/*npdcch_encoding_NB_IoT(dci_alloc[i].dci_pdu,
frame_parms,
npdcch, //see when function dci_top is called
//no frame
subframe
//rm_stats, te_stats, i_stats
);*/
}
......@@ -150,7 +115,8 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
* G = 200
*/
/*
// NB-IoT scrambling
npdcch_scrambling_NB_IoT(
frame_parms,
npdcch,
......@@ -161,7 +127,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//NB-IoT
//NB-IoT modulation
npdcch_modulation_NB_IoT(
txdataF,
AMP,
......@@ -169,7 +135,7 @@ uint8_t generate_dci_top_NB(uint8_t Num_dci,
//no symbol
//npdcch0???
//RB_ID --> statically get from the higher layer (may included in the dl_frame params)
);
);*/
......
......@@ -29,6 +29,9 @@
* \note
* \warning
*/
#ifndef __DCI_NB_IOT_H__
#define __DCI_NB_IOT_H__
#ifndef USER_MODE
#include "PHY/types.h"
#else
......@@ -281,3 +284,7 @@ struct DCIN2_Pag{
typedef struct DCIN2_Pag DCIN2_Pag_t;
#define sizeof_DCIN2_Pag_t 15
#define MAX_DCI_SIZE_BITS_NB_IOT 23
#endif
\ No newline at end of file
......@@ -62,8 +62,8 @@ void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size
}
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
eNB_rxtx_proc_NB_t *proc,
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
......@@ -137,12 +137,13 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
}
}
int NB_generate_eNB_dlsch_params_from_dci(int frame,
int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
LTE_eNB_DLSCH_t **dlsch,
LTE_eNB_DLSCH_t *dlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation,
uint8_t Num_dci
......@@ -304,4 +305,4 @@ int NB_generate_eNB_dlsch_params_from_dci(int frame,
return(0);
}
\ No newline at end of file
}
......@@ -901,7 +901,7 @@ typedef struct {
/// Pointers to 8 HARQ processes for the ULSCH
LTE_UL_eNB_HARQ_t *harq_process;
/// Maximum number of HARQ rounds
//uint8_t Mlimit;
uint8_t Mlimit;
/// Maximum number of iterations used in eNB turbo decoder
//uint8_t max_turbo_iterations;
//boundling not exist in NB-IoT since we are not using TDD and only 1 HARQ process
......
......@@ -31,36 +31,13 @@
*/
#ifndef __LTE_TRANSPORT_DEFS_NB_IOT__H__
#define __LTE_TRANSPORT_DEFS_NB_IOT__H__
#include "PHY/defs.h"
#include "dci_nb_iot.h"
#include "PHY/defs.h"
#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
typedef struct {
/// Length of DCI in bits
uint8_t dci_length;
/// Aggregation level only 0,1 in NB-IoT
uint8_t L;
/// Position of first CCE of the dci
int firstCCE;
/// flag to indicate that this is a RA response
boolean_t ra_flag;
/// rnti
rnti_t rnti;
/// Format
DCI_format_NB_t format;
/// DCI pdu
uint8_t dci_pdu[8];
} DCI_ALLOC_NB_t;
typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1
uint32_t num_npdcch_symbols;
uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ;
} DCI_PDU_NB;
// to be created LTE_eNB_DLSCH_t --> is duplicated for each number of UE and then indexed in the table
......
......@@ -93,8 +93,8 @@ void npbch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
void NB_add_dci(DCI_PDU_NB *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt);
/*Use the UL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
eNB_rxtx_proc_NB_t *proc,
int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
......@@ -103,14 +103,17 @@ int NB_generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB_NB *eNB,
uint8_t Num_dci
);
/*Use the DL DCI Information to configure PHY and also Packed*/
int NB_generate_eNB_dlsch_params_from_dci(int frame,
int NB_generate_eNB_dlsch_params_from_dci(PHY_VARS_eNB *eNB,
int frame,
uint8_t subframe,
DCI_CONTENT *DCI_Content,
uint16_t rnti,
DCI_format_NB_t dci_format,
LTE_eNB_DLSCH_t **dlsch,
LTE_eNB_DLSCH_t *dlsch,
NB_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation,
uint8_t Num_dci
);
#endif
......@@ -216,6 +216,7 @@ typedef struct {
pthread_mutex_t mutex_rxtx;
/// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx;
} eNB_rxtx_proc_t;
typedef struct {
......@@ -428,6 +429,30 @@ typedef struct {
UE_rxtx_proc_t proc_rxtx[2];
} UE_proc_t;
typedef struct {
/// Length of DCI in bits
uint8_t dci_length;
/// Aggregation level only 0,1 in NB-IoT
uint8_t L;
/// Position of first CCE of the dci
int firstCCE;
/// flag to indicate that this is a RA response
boolean_t ra_flag;
/// rnti
rnti_t rnti;
/// Format
DCI_format_NB_t format;
/// DCI pdu
uint8_t dci_pdu[8];
} DCI_ALLOC_NB_t;
typedef struct {
//delete the count for the DCI numbers,NUM_DCI_MAX should set to 1
uint32_t num_npdcch_symbols;
uint8_t Num_dci;
DCI_ALLOC_NB_t dci_alloc[2] ;
} DCI_PDU_NB;
/// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s {
......@@ -701,7 +726,7 @@ typedef struct PHY_VARS_eNB_s {
NB_IoT_eNB_NDLSCH_t *dlsch_SI_NB,*dlsch_ra_NB;
NB_DL_FRAME_PARMS frame_parms_nb_iot;
DCI_PDU_NB DCI_pdu;
DCI_PDU_NB *DCI_pdu;
......@@ -988,6 +1013,7 @@ void exit_fun(const char* s);
static inline int wait_on_condition(pthread_mutex_t *mutex,pthread_cond_t *cond,int *instance_cnt,char *name) {
// lock the mutex, if lock successfully, it would return the 0, the other value means failed
if (pthread_mutex_lock(mutex) != 0) {
LOG_E( PHY, "[SCHED][eNB] error locking mutex for %s\n",name);
exit_fun("nothing to add");
......
......@@ -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
......
......@@ -7,8 +7,12 @@
#include "PHY/defs_nb_iot.h"
#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
void process_schedule_rsp(Sched_Rsp_t *sched_rsp,
PHY_VARS_eNB *eNB,
eNB_rxtx_proc_NB_t *proc);
/*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>
......@@ -59,6 +57,7 @@
#endif /* USER_MODE */
#include "defs.h"
#include "openair2/PHY_INTERFACE/IF_Module_nb_iot.h"
//#include "dlc_engine.h"
extern int openair_sched_status;
......@@ -78,7 +77,9 @@ extern fifo_dump_emos_eNB emos_dump_eNB;
#endif
*/
extern Sched_Rsp_t* Sched_Rsp;
#endif /*__SCHED_EXTERN_H__ */
......@@ -1086,6 +1086,7 @@ LTE_eNB_UE_stats* get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti)
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
{
uint8_t i;
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
......@@ -1110,6 +1111,25 @@ int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
return(-1);
}
int8_t find_ue_NB(uint16_t rnti, PHY_VARS_eNB *eNB)
{
uint8_t i;
for (i=0; i<NUMBER_OF_UE_MAX_NB_IoT; i++) {
if ((eNB->ndlsch[i]) &&
(eNB->ndlsch[i]->rnti==rnti)) {
return(i);
}
}
return(-1);
}
LTE_DL_FRAME_PARMS* get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id)
{
......
#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
......@@ -18,7 +18,7 @@
// P5 FAPI-like configuration structures
// P5 FAPI-like configuration structures-------------------------------------------------------------------------------
/*MP: MISSED COMMON CONFIG. of SIB2-NB in FAPI SPECS (may non needed)*/
typedef struct{
......@@ -99,9 +99,7 @@ typedef struct{
// uplink subframe P7
// uplink subframe P7---------------------------------------------------------------------------------
/*UL_IND_t:
......@@ -169,24 +167,22 @@ typedef struct{
}npdcch_t;
typedef struct{
//for indicate receiving the NPUSCH
nfapi_ul_config_nulsch_pdu nulsch_pdu;
//for indicate receiving the NPRACH
nfapi_ul_config_nrach_pdu nrach_pdu;
nfapi_ul_config_request_pdu_t ulsch_pdu;
}nulsch_t;
typedef union{
typedef struct{
// these structures contains both instruction and PDUs itself
npdcch_t NB_DCI;
npdcch_t *NB_DCI;
npdsch_t NB_DLSCH;
npdsch_t *NB_DLSCH;
npbch_t NB_BCH;
npbch_t *NB_BCH;
nulsch_t NB_UL;
nulsch_t *NB_UL_config;
}NB_DL_u;
}NB_DL_t;
typedef struct{
......@@ -202,7 +198,7 @@ typedef struct{
//subframe
sub_frame_t subframeP;
NB_DL_u NB_DL;
NB_DL_t NB_DL;
}Sched_Rsp_t;
......@@ -211,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;
......
......@@ -575,13 +575,18 @@ int wait_CCs(eNB_rxtx_proc_t *proc) {
return(0);
}
/*NB-IoT rxtx
* IMPORTANT
* When we run the rxtx thread for NB-IoT we should not run at the same time otherwise we fill the same buffers in PHY_Vars_eNB
* */
static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
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);
......@@ -591,11 +596,13 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
if ((eNB->do_prach)&&((eNB->node_function != NGFI_RCC_IF4p5)))
eNB->do_prach(eNB,proc->frame_rx,proc->subframe_rx);
// skip the comment for this moment
/*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, send the UL_Indication to higher layer that also provide a tick to the scheduler
......@@ -620,6 +627,51 @@ static inline int NB_rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_
return(0);
}
/*!
* \brief The RX UE-specific and TX thread of NB-IoT eNB (NB-rxtx).
* \param param is a \ref eNB_proc_t structure which contains the info what to process.
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
static void* eNB_thread_NB_rxtx( void* param ) {
static int eNB_thread_rxtx_status;
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
char thread_name[100];
// set default return value
eNB_thread_rxtx_status = 0;
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[0] == proc ? 0 : 1);
thread_top_init(thread_name,1,850000L,1000000L,2000000L);
while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
if (oai_exit) break;
if (eNB->CC_id==0)
if (NB_rxtx(eNB,proc,thread_name) < 0) break;
} // while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
printf( "Exiting eNB thread RXn_TXnp4\n");
eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status;
}
static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf);
......
......@@ -171,7 +171,7 @@ void init_lte_eNB_NB(
LOG_I(PHY,"init eNB NB_IoT: Nid_cell %d\n", frame_parms->Nid_cell);
LOG_I(PHY,"init eNB NB_IoT: number of ue max %d number of enb max %d \n",
NUMBER_OF_UE_MAX, NUMBER_OF_eNB_MAX);
LOG_I(PHY,"init eNB NB_IoT: N_RB_DL %d\n", frame_parms->N_RB_DL);
//LOG_I(PHY,"init eNB NB_IoT: N_RB_DL %d\n", frame_parms->N_RB_DL);
//LOG_I(PHY,"init eNB NB_IoT: prach_config_index %d\n", frame_parms->nprach_config_common.prach_ConfigInfo.prach_ConfigIndex);
if (node_function >= NGFI_RRU_IF5)
......@@ -185,15 +185,15 @@ void init_lte_eNB_NB(
* In NB-IoT we not transmit two dlsch pdu at the same time so the dlsch dimension in PHY_vars_eNB for NB-IoT is just an array
*/
for (i=0; i<NUMBER_OF_UE_MAX_NB_IOT; i++) {
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
LOG_I(PHY,"[NB-IoT] Allocating Transport Channel Buffers for NDLSCH, UE %d\n",i);
PHY_vars_eNB->ndlsch[i] = new_eNB_dlsch_NB(NSOFT,abstraction_flag,frame_parms);
if (!PHY_vars_eNB->ndlsch[i]) {
LOG_E(PHY,"Can't get eNB ndlsch structures for UE %d \n", i);
exit(-1);
} else {
LOG_D(PHY,"dlsch[%d] => %p\n",i,PHY_vars_eNB->dlsch[i]);
PHY_vars_eNB->dlsch[i]->rnti=0;
LOG_D(PHY,"dlsch[%d] => %p\n",i,PHY_vars_eNB->ndlsch[i]);
PHY_vars_eNB->ndlsch[i]->rnti=0;
}
......
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