Commit ebab3325 authored by Matthieu Kanj's avatar Matthieu Kanj

adding UL indication for NPUSCH channel

parent 6d5e60f3
......@@ -327,7 +327,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *phy_vars_eNB,
uint8_t cooperation_flag);
void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
......
......@@ -2053,7 +2053,7 @@ void rx_ulsch_NB_IoT(PHY_VARS_eNB *eNB,
int32_t llr_msg5[16];
int32_t y_msg5[16];
void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
......@@ -2089,7 +2089,8 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
// uint8_t log2_maxh = 0,aarx;
//uint8_t harq_pid;
uint8_t Qm;
//int subframe = proc->subframe_rx;
int subframe = proc->subframe_rx;
int frame = proc->frame_rx;
//uint8_t npusch_format = 1; // NB-IoT: format 1 (data), or 2: ack. Should be defined in higher layer
//uint8_t subcarrier_spacing = frame_parms->subcarrier_spacing; // 15 kHz or 3.75 kHz
uint8_t pilot_pos1_format1_15k = 3, pilot_pos2_format1_15k = 10; // holds for npusch format 1, and 15 kHz subcarrier bandwidth
......@@ -2515,8 +2516,15 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
}
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else {
//printf("\n in last cdn break \n");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
break;
}
} // r loop end
......@@ -2564,10 +2572,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
if (counter_ack>8) //hard decision
{
printf(" decoded msg5: ACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else if (counter_ack<8) { //hard decision
printf(" decoded msg5: NACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else { //when equality (8 bits 0 vs 8 bits 1), soft decision
......@@ -2581,10 +2595,16 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
{
printf(" decoded msg5 (soft): ACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,0); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
} else {
printf(" decoded msg5 (soft): NACK ");
fill_crc_indication_NB_IoT(eNB,0,frame,subframe,1); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,option);
}
}
printf("\n\n\n");
......
......@@ -527,6 +527,8 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag);
/*@}*/
......
......@@ -22,7 +22,7 @@ void process_schedule_rsp_NB_IoT(Sched_Rsp_NB_IoT_t *sched_rsp,
eNB_rxtx_proc_t *proc);
/*Processing the ue-specific resources for uplink in NB-IoT*/
void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t *proc, UL_IND_NB_IoT_t *UL_INFO);
void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc); // UL_IND_NB_IoT_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 common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
......@@ -50,6 +50,11 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP,
uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control);
////////////////// NB-IoT testing ////////////////////
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control);
#endif
......@@ -613,7 +613,6 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) {
/////////////////////////////////////////////////// NPUSH DEMOD ////////////////////////////////////
// LTE_eNB_COMMON *common_vars = &eNB->common_vars;
rx_ulsch_Gen_NB_IoT(eNB,
proc,
0,//eNB_id, // this is the effective sector id
......@@ -2922,8 +2921,8 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
UL_info->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti);*/
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.nrach_ind.number_of_initial_scs_detected = 1; // should be set to zero in every call of UL_indication
//////////////////////////////////////////////////////////
eNB->UL_INFO.nrach_ind.number_of_initial_scs_detected = 1; //!!!!!!!!!!!!! // should be set to zero in every call of UL_indication !!!!!!!!!!!!!!!!!!!!!!!
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.rnti = rnti[0];
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.initial_sc = preamble_index[0];
eNB->UL_INFO.nrach_ind.nrach_pdu_list[0].nrach_indication_rel13.timing_advance = timing_advance_preamble[0];
......@@ -2945,7 +2944,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
}
}
//////////////////////////////////////////////////////////// END ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void prach_procedures(PHY_VARS_eNB *eNB) {
// LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
......@@ -3876,6 +3875,33 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc){
///VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_COMMON+offset, 0 );
}
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control)
{
nfapi_rx_indication_pdu_t *pdu;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 1;
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; // do we need this ??
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.rnti = rnti; // rnti should be got from eNB structure
//pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[0];
// pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
//pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
pdu->rx_indication_rel8.length = 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[UE_id]->harq_processes[harq_pid]->b;
//eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
//eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
// do we need to transmit timing ?? however, the nfapi structure does not include timing paramters !!!!!
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const relaying_type_t r_type)
{
......
......@@ -649,18 +649,13 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
// UE-specific RX processing for subframe n
///////////////////////////////////// for NB-IoT testing ////////////////////////
// for NB-IoT testing // activating only TX part
/// if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay );
if (eNB->proc_uespec_rx) eNB->proc_uespec_rx(eNB, proc, no_relay );
////////////////////////////////////END///////////////////////
//npusch_procedures(eNB,proc,data_or_control);
//fill_rx_indication(eNB,i,frame,subframe);
//////////////////////////////////// for IF Module/scheduler testing
//LOG_I(PHY,"Before UL_indication\n");
eNB->UL_INFO.frame = proc->frame_rx;
eNB->UL_INFO.subframe = proc->subframe_rx;
eNB->UL_INFO.module_id = eNB->Mod_id;
eNB->UL_INFO.CC_id = eNB->CC_id;
//eNB->if_inst->UL_indication(&eNB->UL_INFO);
//LOG_I(PHY,"After UL_indication\n");
// *****************************************
......@@ -2212,7 +2207,10 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->fep = eNB_fep_full;//(single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full;
eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data;
eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding;
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
////////////////////// NB-IoT testing ////////////////////
//eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX_NB_IoT;
eNB->proc_tx = proc_tx_full;
eNB->tx_fh = NULL;
eNB->rx_fh = rx_rf;
......
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