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
......@@ -2492,7 +2493,7 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
&eNB->ulsch_tc_intl1_stats,
&eNB->ulsch_tc_intl2_stats);
if (ret != (1+ulsch_NB_IoT[UE_id]->max_turbo_iterations))
if (ret != (1+ulsch_NB_IoT[UE_id]->max_turbo_iterations))
{
//printf("\n in last cdn \n");
if (r<ulsch_harq->Cminus)
......@@ -2513,11 +2514,18 @@ void rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0));
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");
break;
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 ");
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];
......@@ -2931,7 +2930,7 @@ void prach_procedures_NB_IoT(PHY_VARS_eNB *eNB) {
eNB->UL_INFO.frame = frame;
eNB->UL_INFO.subframe = subframe;
//eNB->UL_INFO.hypersfn = ;
//eNB->UL_INFO.hypersfn = ;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
......@@ -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)
{
......
......@@ -408,10 +408,42 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
}
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)
{
//RX processing for ue-specific resources (i
//NB_IoT_DL_FRAME_PARMS *fp=&eNB->frame_parms_NB_IoT;
const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx;
/*
///////////////////// do we need this part for NB-IoT ///////////////////////////////////
//check if any RB using in this UL subframe
eNB->rb_mask_ul[0] = 0;
eNB->rb_mask_ul[1] = 0;
eNB->rb_mask_ul[2] = 0;
eNB->rb_mask_ul[3] = 0;
////////////////////////////////////////////////////////////////////////////////////////
*/
uint8_t data_or_control=0;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
// Fix me here, these should be locked
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 0;
eNB->UL_INFO.crc_ind.number_of_crcs = 0;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
// if (nfapi_mode == 0 || nfapi_mode == 1) { // If PNF or monolithic
npusch_procedures(eNB,proc,data_or_control);
//}
}
/////////////////////////////////////////////////////////// backup ////////////////////////////////////////////////////////
/*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)
{
//RX processing for ue-specific resources (i
uint32_t ret=0,i,j,k;
uint32_t harq_pid; // round;
int sync_pos;
......@@ -424,7 +456,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
// add hyper subframe here
/*NB-IoT IF module Common setting*/
//NB-IoT IF module Common setting//
UL_INFO->module_id = eNB->Mod_id;
UL_INFO->CC_id = eNB->CC_id;
......@@ -450,7 +482,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
harq_pid = subframe2harq_pid_NB_IoT(fp,frame,subframe);
// delete the cba
// delete the srs
/*Loop over the UE, i is the UE ID */
//Loop over the UE, i is the UE ID //
for (i=0; i<NUMBER_OF_UE_MAX_NB_IoT; i++)
{
......@@ -461,7 +493,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
{
if (eNB->UE_stats[i].mode == RA_RESPONSE_NB_IoT)
{
/*Process Msg3 TODO*/
///Process Msg3 TODO///
//process_Msg3(eNB,proc,i,harq_pid);
}
}
......@@ -470,23 +502,23 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
eNB->pusch_stats_round[i][(frame*10)+subframe] = 0;
eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63;
/*Check if this UE is has ULSCH scheduling*/
//Check if this UE is has ULSCH scheduling///
if ((eNB->nulsch[i]) &&
(eNB->nulsch[i]->rnti>0) &&
(eNB->nulsch[i]->harq_process->subframe_scheduling_flag==1))
{
// UE is has ULSCH scheduling
//////////////////////////////////////round = eNB->nulsch[i]->harq_process->round; //commented to remove warning, to be added if round is used
/*NB-IoT The nb_rb always set to 1 */
//NB-IoT The nb_rb always set to 1 //
for (int rb=0;rb<=eNB->nulsch[i]->harq_process->nb_rb;rb++)
{
int rb2 = rb+eNB->nulsch[i]->harq_process->first_rb;
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
}
/*Log for what kind of the ULSCH Reception*/
//Log for what kind of the ULSCH Reception//
/*Calculate for LTE C-RS*/
//Calculate for LTE C-RS//
//nPRS = fp->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
//eNB->ulsch[i]->cyclicShift = (eNB->ulsch[i]->harq_processes[harq_pid]->n_DMRS2 + fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +nPRS)%12;
......@@ -494,7 +526,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
if (fp->frame_type == FDD_NB_IoT )
{
int sf = (subframe<4) ? (subframe+6) : (subframe-4);
/*After Downlink Data transmission, simply have a notice to received ACK from PUCCH, I think it's not use for now */
//After Downlink Data transmission, simply have a notice to received ACK from PUCCH, I think it's not use for now //
if (eNB->ndlsch[i]->subframe_tx[sf]>0) // we have downlink transmission
{
eNB->nulsch[i]->harq_process->O_ACK = 1;
......@@ -558,18 +590,18 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
if (eNB->nulsch[i]->Msg3_flag == 1)
{
/*dump_ulsch(eNB,proc,i);
exit(-1);*/
///dump_ulsch(eNB,proc,i);
//exit(-1);//
/*In NB-IoT MSG3 */
//In NB-IoT MSG3 //
// activate retransmission for Msg3 (signalled to UE PHY by DCI
eNB->nulsch[(uint32_t)i]->Msg3_active = 1;
/* Need to check the procedure for NB-IoT (MSG3) retransmission
get_Msg3_alloc_ret(fp,subframe,frame,&eNB->ulsch[i]->Msg3_frame,&eNB->ulsch[i]->Msg3_subframe);
mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, eNB->ulsch[i]->rnti,eNB->ulsch[i]->Msg3_frame, eNB->ulsch[i]->Msg3_subframe);
*/
// Need to check the procedure for NB-IoT (MSG3) retransmission
// get_Msg3_alloc_ret(fp,subframe,frame,&eNB->ulsch[i]->Msg3_frame,&eNB->ulsch[i]->Msg3_subframe);
//mac_xface->set_msg3_subframe(eNB->Mod_id, eNB->CC_id, frame, subframe, eNB->ulsch[i]->rnti,eNB->ulsch[i]->Msg3_frame, eNB->ulsch[i]->Msg3_subframe);
T(T_ENB_PHY_MSG3_ALLOCATION, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe),
T_INT(i), T_INT(eNB->nulsch[i]->rnti), T_INT(0 /* 0 is for retransmission*/),
T_INT(i), T_INT(eNB->nulsch[i]->rnti), T_INT(0),
T_INT(eNB->nulsch[i]->Msg3_frame), T_INT(eNB->nulsch[i]->Msg3_subframe));
} // This is Msg3 error
else
......@@ -580,10 +612,10 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
eNB->nulsch[i]->harq_process->phich_active=0;
eNB->UE_stats[i].ulsch_errors[harq_pid]++;
eNB->UE_stats[i].ulsch_consecutive_errors++;
/*if (eNB->ulsch[i]->harq_processes[harq_pid]->nb_rb > 20) {
dump_ulsch(eNB,proc,i);
exit(-1);
}*/
//if (eNB->ulsch[i]->harq_processes[harq_pid]->nb_rb > 20) {
// dump_ulsch(eNB,proc,i);
// exit(-1);
//}
// indicate error to MAC
if (eNB->mac_enabled == 1)
{
......@@ -613,8 +645,8 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
hundred_times_log10_NPRB_NB_IoT[eNB->nulsch[i]->harq_process->nb_rb-1]/100 -
get_hundred_times_delta_IF_eNB_NB_IoT(eNB,i,harq_pid, 0)/100;
//for NB-IoT PHICH not work
/*eNB->ulsch[i]->harq_processes[harq_pid]->phich_active = 1;
eNB->ulsch[i]->harq_processes[harq_pid]->phich_ACK = 1;*/
//eNB->ulsch[i]->harq_processes[harq_pid]->phich_active = 1;
//eNB->ulsch[i]->harq_processes[harq_pid]->phich_ACK = 1;//
eNB->nulsch[i]->harq_process->round = 0;
eNB->UE_stats[i].ulsch_consecutive_errors = 0;
......@@ -636,17 +668,17 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
UL_INFO->RX_NPUSCH.number_of_pdus++;
}
/* Need check if this needed in NB-IoT
// Need check if this needed in NB-IoT
// one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI)
if (eNB->ulsch[i]->Msg3_flag == 0 ) {
eNB->UE_stats[i].mode = PRACH;
mac_xface->cancel_ra_proc(eNB->Mod_id,
eNB->CC_id,
frame,
eNB->UE_stats[i].crnti);
mac_phy_remove_ue(eNB->Mod_id,eNB->UE_stats[i].crnti);
eNB->ulsch[(uint32_t)i]->Msg3_active = 0;
} // Msg3_flag == 0*/
// if (eNB->ulsch[i]->Msg3_flag == 0 ) {
// eNB->UE_stats[i].mode = PRACH;
// mac_xface->cancel_ra_proc(eNB->Mod_id,
// eNB->CC_id,
// frame,
// eNB->UE_stats[i].crnti);
// mac_phy_remove_ue(eNB->Mod_id,eNB->UE_stats[i].crnti);
// eNB->ulsch[(uint32_t)i]->Msg3_active = 0;
// } // Msg3_flag == 0///
} // mac_enabled==1
......@@ -655,7 +687,7 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",eNB->Mod_id,frame,subframe,i);
/*Init HARQ parameters, need to check*/
//Init HARQ parameters, need to check//
for (k=0; k<8; k++)
{ //harq_processes
for (j=0; j<eNB->ndlsch[i]->Mlimit; j++)
......@@ -706,12 +738,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
// Process HARQ only in NPUSCH
/*process_HARQ_feedback(i,
eNB,proc,
1, // pusch_flag
0,
0,
0);*/
//process_HARQ_feedback(i,
// eNB,proc,
// 1, // pusch_flag
// 0,
// 0,
// 0);/
......@@ -727,10 +759,12 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_
} // loop i=0 ... NUMBER_OF_UE_MAX-1
}
////////////////////////////////////////////////////////////////end backup ////////////////////////////////////////////////
#undef DEBUG_PHY_PROC
/*Generate eNB ndlsch params for NB-IoT from the NPDCCH PDU of the DCI, modify the input to the Sched Rsp variable*/
/////Generate eNB ndlsch params for NB-IoT from the NPDCCH PDU of the DCI, modify the input to the Sched Rsp variable////
*/
void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,eNB_rxtx_proc_t * proc,nfapi_dl_config_request_pdu_t *dl_config_pdu)
{
......@@ -1520,8 +1554,6 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16
uint32_t estimated_TA;
//int frame,frame_mod; // subframe,
// subframe = eNB->proc.subframe_prach;
// frame = eNB->proc.frame_prach;
......@@ -1534,4 +1566,116 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16
//printf("estim = %i\n",estimated_TA);
// }
return estimated_TA;
}
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
// nfapi_crc_indication_pdu_t* crc_pdu_list
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_pdu_list[0]; //[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
///eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
//eNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
//eNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
//pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
pdu->crc_indication_rel8.crc_flag = crc_flag;
eNB->UL_INFO.crc_ind.number_of_crcs++;
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control)
{
uint32_t i;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT;
NB_IoT_UL_eNB_HARQ_t *ulsch_harq;
const int subframerx = proc->subframe_rx;
const int framerx = proc->frame_rx;
for (i=0; i<NUMBER_OF_UE_MAX; i++)
{
ulsch_NB_IoT = eNB->ulsch_NB_IoT[i];
ulsch_harq = ulsch_NB_IoT->harq_process;
// if eNB is ready to receive UL data
// define a flag to trigger on or off the decoding process
//if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0))
if ((ulsch_NB_IoT) && (ulsch_NB_IoT->rnti>0)) // && (ulsch_harq->frame == framerx) && (ulsch_harq->subframe == subframerx))
{
/*
// UE has ULSCH scheduling
for (int rb=0; rb<=ulsch_harq->nb_rb; rb++)
{
int rb2 = rb+ulsch_harq->first_rb;
eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
}
*/
//rx_ulsch(eNB,proc, i);
/*ret = ulsch_decoding(eNB,proc,
i,
0, // control_only_flag
ulsch_harq->V_UL_DAI,
ulsch_harq->nb_rb>20 ? 1 : 0);*/
// fill_ulsch_cqi_indication(eNB,frame,subframe,ulsch_harq,ulsch->rnti);
////// nulsch_config should be provided before calling the rx_ulsch function
/*typedef struct {
nfapi_tl_t tl;
uint8_t nulsch_format; --> this parameter is needed
uint32_t handle;
uint16_t size;
uint16_t rnti; --> this parameter is needed
uint8_t subcarrier_indication; --> this parameter is needed
uint8_t resource_assignment;
uint8_t mcs; --> this parameter is needed
uint8_t redudancy_version;
uint8_t repetition_number; --> this parameter is needed
uint8_t new_data_indication;
uint8_t n_srs;
uint16_t scrambling_sequence_initialization_cinit; --> this parameter is needed
uint16_t sf_idx;
nfapi_ul_config_ue_information ue_information;
nfapi_ul_config_nb_harq_information nb_harq_information;
} nfapi_ul_config_nulsch_pdu_rel13_t;
#define NFAPI_UL_CONFIG_REQUEST_NULSCH_PDU_REL13_TAG 0x205F
*/
rx_ulsch_Gen_NB_IoT(eNB,
proc,
0, // this is the effective sector id
0,
ulsch_NB_IoT,
1, //npusch_format, // 1, 2
22, // 22 , to be included in // to be replaced by NB_IoT_start ??
1, // 0 (3.75 KHz) or 1 (15 KHz)
65522, //= 65522
proc->subframe_dscr_msg3, // first received subframe
proc->frame_dscr_msg3, // first received frame
16, // total number of occupied slots
11,
1,
2,
88, // A = TBS
proc->counter_msg3, // proc->counter_msg3
subframerx,
data_or_control); // data (0) or control (1)
}
} // for UE loop
}
\ No newline at end of file
......@@ -649,19 +649,14 @@ 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");
// *****************************************
// TX processing for subframe n+4
......@@ -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