Commit 2d2c80db authored by Nick Ho's avatar Nick Ho

Revise UL_indication to handle the Ack information

parent f9f541cd
......@@ -1634,12 +1634,13 @@ void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t d
if(decode_flag == 1)
{
eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.number_of_harqs =1;
ack_ind = &eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0];
ack_ind->nb_harq_indication_fdd_rel13.harq_tb1 = 1;
ack_ind->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
} else {
eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.number_of_harqs =1;
ack_ind = &eNB->UL_INFO.nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0];
ack_ind->nb_harq_indication_fdd_rel13.harq_tb1 = 2;
ack_ind->rx_ue_information.rnti = eNB->ulsch_NB_IoT[0]->rnti;
......
......@@ -78,78 +78,74 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
int i=0;
uint32_t abs_subframe;
Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO;
//UE_TEMPLATE_NB_IoT *UE_info;
enable_preamble_simulation(UL_INFO,0);
enable_msg3_simulation(UL_INFO,0);
//if(preamble_trigger==0)
//{
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
{
// only use one preamble now
//for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++)
for(i=0;i<1;i++)
{
// initiate_ra here, some useful inforamtion :
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
LOG_D(MAC,"Init_RA_NB_IoT in, index of sc = %d\n",(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc);
init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);
LOG_D(MAC,"Init_RA_NB_IoT Out\n");
}
}
//}
UL_INFO->nrach_ind.number_of_initial_scs_detected = 0;
/* Disable uplink RX function for now
// crc indication if there is error for this round UL transmission
if(UL_INFO->crc_ind.number_of_crcs>0)
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
{
// only use one preamble now
//for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++)
for(i=0;i<1;i++)
{
// initiate_ra here, some useful inforamtion :
LOG_D(MAC,"Init_RA_NB_IoT in, index of sc = %d\n",(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc);
init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);
}
}
UL_INFO->nrach_ind.number_of_initial_scs_detected = 0;
/* Disable crc function for now
// crc indication if there is error for this round UL transmission
if(UL_INFO->crc_ind.number_of_crcs>0)
{
for(i=0;i<UL_INFO->crc_ind.number_of_crcs;i++)
{
if((UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag == 0)
{
for(i=0;i<UL_INFO->crc_ind.number_of_crcs;i++)
{
if((UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag == 0)
{
//unsuccessfully received this UE PDU
//UE_info = get_ue_from_rnti(mac_inst,((UL_INFO->crc_ind.crc_pdu_list)+i)->rx_ue_information.rnti);
//UE_info->HARQ_round++;
}
}
//unsuccessfully received this UE PDU
//UE_info = get_ue_from_rnti(mac_inst,((UL_INFO->crc_ind.crc_pdu_list)+i)->rx_ue_information.rnti);
//UE_info->HARQ_round++;
}
}
}
*/
// Check if there is any feed back of HARQ
if(UL_INFO->nb_harq_ind.nb_harq_indication_body.number_of_harqs>0)
{
LOG_I(MAC,"Recieved Ack of DL Data\n");
}
UL_INFO->nb_harq_ind.nb_harq_indication_body.number_of_harqs = 0;
//If there is a Uplink SDU which needs to send to MAC
if(UL_INFO->RX_NPUSCH.number_of_pdus>0)
{
for(i=0;i<UL_INFO->RX_NPUSCH.number_of_pdus;i++)
{
//For MSG3, Normal Uplink Data, NAK
rx_sdu_NB_IoT(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
);
}
}
*/
//If there is a Uplink SDU which needs to send to MAC
if(UL_INFO->RX_NPUSCH.number_of_pdus>0)
{
for(i=0;i<UL_INFO->RX_NPUSCH.number_of_pdus;i++)
{
//For MSG3, Normal Uplink Data, NAK
rx_sdu_NB_IoT(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.number_of_pdus = 0;
UL_INFO->RX_NPUSCH.number_of_pdus = 0;
if(UL_INFO->hypersfn==1 && UL_INFO->frame==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